• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: file reading/writing over 2 gig
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: file reading/writing over 2 gig
      • From: Jaime Magiera <email@hidden>
References: 
 >file reading/writing over 2 gig (From: Jaime Magiera <email@hidden>)
 >Re: file reading/writing over 2 gig (From: Sherm Pendley <email@hidden>)
 >Re: file reading/writing over 2 gig (From: Jaime Magiera <email@hidden>)

  • Prev by Date: Problem with drawBackgroundForGlyphRange:atPoint:
  • Next by Date: Re: Need an alternative to Interface Builder for a good reason
  • Previous by thread: Re: file reading/writing over 2 gig
  • Next by thread: Re: file reading/writing over 2 gig
  • Index(es):
    • Date
    • Thread