Re: Opening a file read-only?

2011-08-10 Thread Wade Tregaskis
Try running fs_usage while your app is running, and you’ll be able to see what files it opens and in which modes. (Or there’s probably an Instrument for that now?) There's half a dozen related to file I/O, which unfortunately makes it very awkward to use for even simple tasks like this. You

Re: Opening a file read-only?

2011-08-10 Thread Douglas Davidson
On Aug 10, 2011, at 8:10 AM, Wade Tregaskis wrote: Note also that initWithContentsOfMappedFile: is deprecated in 10.7. There doesn't appear to be a replacement; I presume you're supposed to use initWithContentsOfFile:, but that really does read the entire file in at init time (into a

Re: Opening a file read-only?

2011-07-20 Thread Jens Alfke
On Jul 19, 2011, at 6:55 PM, Graham Cox wrote: Because we just got rejected on the App Store for opening a file with read/write access in a place that's not allowed. I've checked the code that we're not writing or creating files to these locations - we're not - so the only other

Opening a file read-only?

2011-07-19 Thread Graham Cox
I'm using +[NSData dataWithContentsOfMappedFile:] to access a file. Is it possible to ensure this opens read-only? I see there's a version that takes options, but none of these options seem to open it read-only. --Graham ___ Cocoa-dev mailing list

Re: Opening a file read-only?

2011-07-19 Thread Greg Parker
On Jul 19, 2011, at 6:29 PM, Graham Cox wrote: I'm using +[NSData dataWithContentsOfMappedFile:] to access a file. Is it possible to ensure this opens read-only? I see there's a version that takes options, but none of these options seem to open it read-only. I believe it already opens the

Re: Opening a file read-only?

2011-07-19 Thread Graham Cox
On 20/07/2011, at 11:43 AM, Greg Parker wrote: On Jul 19, 2011, at 6:29 PM, Graham Cox wrote: I'm using +[NSData dataWithContentsOfMappedFile:] to access a file. Is it possible to ensure this opens read-only? I see there's a version that takes options, but none of these options seem to