• 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: How to split a big file ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >How to split a big file ? (From: MichaĆ«l Parrot <email@hidden>)
 >Re: How to split a big file ? (From: Martin Wierschin <email@hidden>)

  • Prev by Date: Re: C Strings
  • Next by Date: Re: C Strings
  • Previous by thread: Re: How to split a big file ?
  • Next by thread: PSMTabBarControl isn't added in the app bundle
  • Index(es):
    • Date
    • Thread