Re: How to split a big file ?
Re: How to split a big file ?
- Subject: Re: How to split a big file ?
- From: John Stiles <email@hidden>
- Date: Mon, 20 Mar 2006 22:10:43 -0800
Martin Wierschin wrote:
While mmap and the split command are good options to know about, there
isn't any reason the standard Cocoa classes shouldn't work here.
Glancing at your code there's only one thing I can think of:
while (r=[R read:data maxLength:dec])
{
NSAutoreleasePool *pool=[[NSAutoreleasePool alloc] init];
...
[pool release];
}
Perhaps the -read:maxLength: method is allocating autoreleased data? I
don't see why it should, but try this:
while( 1 ) {
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
r = [R read:data maxLength:dec];
if( 0 == r ) break;
...
[pool release];
}
Careful; as written that block will leak a pool.
(I suppose when the next higher pool is freed, that will take care of
itself. Still, balance is important :) )
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden