Add support to NSFileWrapper for retrieving file paths
| Originator: | tony | ||
| Number: | rdar://14692573 | Date Originated: | 09-Aug-2013 10:42 AM |
| Status: | Open | Resolved: | |
| Product: | OS X SDK | Product Version: | 10.8 |
| Classification: | Enhancement | Reproducible: | Always |
Summary: I'm currently trying to build an NSDocument-based app that uses NSFileWrappers to encapsulate a simple file structure containing a directory of large files: - Project.data: Normal file - Clips: directory - Clip1.mov: video file - Clip2.mov: video file Unfortunately, I'm finding there is no way to directly access the large files (I've used video files as an example here) for use with AVFoundation and other frameworks short of loading each file into memory via regularFileContents, writing the data back to a temporary location on disk, using this temporary copy of the file and then subsequently deleting the temporary file myself. These files can be many hundreds of megabytes (if not gigabytes) — any time I need to copy the file will result in significant delays in display to the user. I'll file a separate radar about allowing NSFileWrappers to exist without loading their regularFileContents into memory unless it's accessed (and then providing some way to flush the contents again). Expected Results: I'd expect to be able to retrieve an NSURL for the individual file wrappers that I can use (even if it's just temporary, and not guaranteed to continue to exist beyond an immediate use). Actual Results: I can't make this work in a way that will keep my app usable and responsive, and at this stage I believe I need to implement my document saving entirely myself.
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!