Re: file reading/writing over 2 gig
Re: file reading/writing over 2 gig
- Subject: Re: file reading/writing over 2 gig
- From: Alastair Houghton <email@hidden>
- Date: Sun, 12 Aug 2007 19:04:05 +0100
On 12 Aug 2007, at 16:41, Jaime Magiera wrote:
NSFileHandle isn't "capped" at 2G - its -offsetInFile and -
seekToFileOffset: methods return and take unsigned long long ints,
respectively. So, one can read/write at any position within Files
of Unusual Size with no trouble.
... but looking at the API, it appears there is only a writeData
method, which takes an NSData. So, I am limited by NSData,
No, you're limited by the amount of address space in a 32-bit
process, whether you use NSData or not.
Due to time constraints, I originally wrote the project using
NSData, which worked great...
[snip]
Then realized this won't work for large files due to the factors
mentioned above.
Rethinking this, it might be better in general to iterate through
the bytes...
It's much better, if you have to iterate through a file working on
the data, to do it in large-ish blocks, not single bytes. Otherwise
your code will be very slow.
Kind regards,
Alastair.
--
http://alastairs-place.net
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden