Re: Write to the end of a file
Re: Write to the end of a file
- Subject: Re: Write to the end of a file
- From: Spencer Salazar <email@hidden>
- Date: Wed, 24 Jan 2007 15:29:38 -0500
If you use an NSFileHandle to open the file for writing, you can use
- (void)seekToEndOfFile to go to the end of the file, and then use -
(void)writeData: to append to the end of the file.
spencer
On Jan 24, 2007, at 3:23 PM, d2kagw wrote:
Hi there,
my application needs to write to a log file, and currently i'm
using a NSString to load the file into memory, append some data and
write back to the file, but as the log file gets larger and larger
the scaling of the application is greatly effected ( since theres
now a few hundred thousand lines in the log, and it isn't getting
smaller )
Is there a way to get Cocoa to just append to the file without
first loading the whole thing into memory???
Cheers
- Az
_______________________________________________
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:
40gmail.com
This email sent to email@hidden
_______________________________________________
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