• 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: Size of a file on disk
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Size of a file on disk


  • Subject: Re: Size of a file on disk
  • From: Martin Wierschin <email@hidden>
  • Date: Wed, 31 Aug 2011 16:57:26 -0700

>>>  NSFileHandle   *hndl = [NSFileHandle fileHandleForReadingAtPath:path];
>>>  long long             lngth = [hndl seekToEndOfFile];
>>>
>>> This gets you the length in bytes.
>>

>> And loads the entire file into memory!!

>
> Does it? I didn't think seek loaded anything, and it was just for random access.

Either way, I think avoiding NSFileHandle is the right thing to do. NSFileHandle implies a desire to read/write data. Who knows what the reading initializer does. Maybe it assigns a file descriptor (limited resource) right away, or does something silly like prefetch data into a buffer.

~Martin

_______________________________________________

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

References: 
 >Re: Size of a file on disk (From: dct <email@hidden>)
 >Re: Size of a file on disk (From: Kyle Sluder <email@hidden>)
 >Re: Size of a file on disk (From: Andy Lee <email@hidden>)
 >Re: Size of a file on disk (From: Kyle Sluder <email@hidden>)

  • Prev by Date: Re: Won't Applescript command use defined ivars?
  • Next by Date: Re: setTitleWithMnemonic
  • Previous by thread: Re: Size of a file on disk
  • Next by thread: Problems with firstResponder
  • Index(es):
    • Date
    • Thread