Re: Creating/saving/appending to files the Cocoa way
Re: Creating/saving/appending to files the Cocoa way
- Subject: Re: Creating/saving/appending to files the Cocoa way
- From: "John C. Welch" <email@hidden>
- Date: Mon, 18 Jan 2010 15:48:59 -0500
- Thread-topic: Creating/saving/appending to files the Cocoa way
On 1/18/10 3:36 PM, "Matt Neuburg" <email@hidden> wrote:
>> So another question on this...looking at NSFileHandle, it doesn't look like
>> there's a good way to say "set the file pointer to <location> and start
>> writing *there*" other than slurping up the existing contents of the file,
>> re-writing them back, then adding in the new data.
>>
>> Is this a correct reading of the docs?
>
> It is not. Had it been, I would not have recommended NSFileHandle as "the
> Cocoa way" to append. Simply use the seek... commands to position the file
> pointer. No slurping occurs. m.
So for example, use seekToEndOfFile, followed by writeData? Just asking
because writeData doesn't have an explicit way to pass the file pointer's
current position, so it looks as though you run seek, then write.
--
GO TEAM ACROBAT ! OUR MOTTO:
We hate you and we want you to die.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
applescriptobjc-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden