• 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: Long text file manipulation...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Long text file manipulation...


  • Subject: Re: Long text file manipulation...
  • From: Chris Nebel <email@hidden>
  • Date: Fri, 06 Apr 2001 15:09:20 -0700
  • Organization: Apple Computer, Inc.

Timothy Bates wrote:

> > 'write "stuff" to file "blah" starting at eof'),
>
> You need eof plus 1 here, or else you overwrite the last character!!!
>
> i.e.,
> set fpath to choose file name
> set f to open for access (fpath) with write permission
> write "FIRST" to f starting at (get eof f) + 1
> write "second" to f starting at (get eof f)
> write "THIRD" to f starting at (get eof f) + 1
> close access f
> set bingle to read fpath
> bingle

Because write uses 1-based file positions, "starting at eof" is not the same
thing as "starting at (get eof f)". Also, there was a bug in 1.5.5 that
"starting at eof" would actually start one character before the end of file.
Version 1.6 and versions earlier than 1.5 don't have the problem.

--Chris Nebel
AppleScript Engineering


  • Follow-Ups:
    • Re: Long text file manipulation...
      • From: Timothy Bates <email@hidden>
References: 
 >Re: Long text file manipulation... (From: Timothy Bates <email@hidden>)

  • Prev by Date: Filemaker portal fields
  • Next by Date: Re: tab delimeted log file
  • Previous by thread: Re: Long text file manipulation...
  • Next by thread: Re: Long text file manipulation...
  • Index(es):
    • Date
    • Thread