Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: writing to a file...



On 31 Jan 2005, at 20:32, Dan Saul wrote:

NSString -writeToFile:atomically: and -initWithContentsOfFIle:

On Mon, 31 Jan 2005 13:15:00 -0700, Martha I. Espinosa <email@hidden> wrote:
Hi,

Hopefully, this is an easy question.  How can I append a file within
my cocoa app?

I can't say that reading in the whole file, adding a line to the end and then writing the whole lot out again atomically sounds like a very sensible plan for a log file.


I would be inclined to create an NSOutputStream using +outputStreamToFileAtPath: append: which should do what you need.

	Cheers,
		Nicko

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >Re: writing to a file... (From: Dan Saul <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.