• 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: Creating/saving/appending to files the Cocoa way
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Re: Creating/saving/appending to files the Cocoa way (From: Matt Neuburg <email@hidden>)

  • Prev by Date: Re: Creating/saving/appending to files the Cocoa way
  • Next by Date: Re: Creating/saving/appending to files the Cocoa way
  • Previous by thread: Re: Creating/saving/appending to files the Cocoa way
  • Next by thread: NSSavePanel oddity
  • Index(es):
    • Date
    • Thread