• 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: NSFileHandle -readInBackgroundAndNotify behavior on EOF
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSFileHandle -readInBackgroundAndNotify behavior on EOF


  • Subject: Re: NSFileHandle -readInBackgroundAndNotify behavior on EOF
  • From: Ken Thomases <email@hidden>
  • Date: Wed, 25 Jun 2008 01:38:57 -0500

On Jun 25, 2008, at 1:31 AM, Rick Mann wrote:

It's not clear from the docs what this method does when the NSFileHandle is associated with a file. The docs say it will return an empty NSData at EOF, but what I'm seeing instead is this: I get back an NSData with -length = 50, even though the file is less than half that length. Upon examination, the data matches that of the file for the first part, and the rest of the bytes look like garbage.

Subsequently, I get notified many times with 0-length data (presumably because I'm at the end of the file).

But why wouldn't it return just the bytes in the file? This seems very broken.

So broken that I doubt it's true. ;) What I mean is I find it more likely that you have a bug in your code.


Please, show us your code so we can have a chance to find the bug (if there is one).

Cheers,
Ken
_______________________________________________

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: 
 >NSFileHandle -readInBackgroundAndNotify behavior on EOF (From: Rick Mann <email@hidden>)

  • Prev by Date: Re: [SOLVED] NSFileHandle -readInBackgroundAndNotify behavior on EOF
  • Next by Date: Re: Newbie question: error in creating a NSData object using handle (Resource Management)
  • Previous by thread: Re: [SOLVED] NSFileHandle -readInBackgroundAndNotify behavior on EOF
  • Next by thread: Get the UUID of the current user
  • Index(es):
    • Date
    • Thread