• 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: Write to the end of a file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Write to the end of a file (From: d2kagw <email@hidden>)

  • Prev by Date: Write to the end of a file
  • Next by Date: How to replace text in a string
  • Previous by thread: Write to the end of a file
  • Next by thread: How to replace text in a string
  • Index(es):
    • Date
    • Thread