Re: init char buffer to null
Re: init char buffer to null
- Subject: Re: init char buffer to null
- From: Nir Soffer <email@hidden>
- Date: Thu, 14 Dec 2006 00:29:02 +0200
On Dec 13, 2006, at 05:51, Sandro Noel wrote:
Well simply put i'm trying to read bytes from a file, recursively,
so the buffer will be freed right after use...
Does this work for you?
NSFileHandle *fileHandle = [NSFileHandle
fileHandleForReadingAtPath:@"foo"];
while (needsMoreData) {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSData *buffer = [fileHandle readDataOfLength:bufferLength];
// Handle the buffer
[pool release];
}
it is not static because i have no clue on how big the string i
will have to read is,
might be half a file, or just a quarter... and the file is Bytes Data.
unless it's a very bad way of doing it.
It is not clear what the file contain and how do you detect the start
and the end of that "string".
i'll try out memset.
thank you much...i read about calloc witch has better
performance... should i use that ?
Shark will tell you that.
Best Regards,
Nir Soffer
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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