Re: [SOLVED] NSFileHandle -readInBackgroundAndNotify behavior on EOF
Re: [SOLVED] NSFileHandle -readInBackgroundAndNotify behavior on EOF
- Subject: Re: [SOLVED] NSFileHandle -readInBackgroundAndNotify behavior on EOF
- From: Rick Mann <email@hidden>
- Date: Tue, 24 Jun 2008 23:37:36 -0700
On Jun 24, 2008, at 23:31:24, 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.
Argh. My bad. I was using old code to dump memory in a formatted way,
and it was padding the bytes.
Sorry for the noise.
--
Rick
_______________________________________________
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