• 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: open for access file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: open for access file


  • Subject: Re: open for access file
  • From: Deivy Petrescu <email@hidden>
  • Date: Fri, 17 Jul 2009 22:27:17 -0400


On Jul 17, 2009, at 7:55 PM, Mark J. Reed wrote:

That applies to reading, too.  After running your script:

<snip>

Basically, without open, you get the whole file in one go. Writing
will create it or replace its entire contents, while reading will
return the whole file. Either action is idempotent: you can do it as
many times as you like with no change in the result.

Open for access introduces state.  After you read or write, the file
is still open, but at the end.  So another write will append, while
another read will signal end-of-file.


On Fri, Jul 17, 2009 at 7:15 PM, Stockly, Ed<email@hidden> wrote:



You must open for access to write to a file however.

Not really:


Cool.

This illustrates the difference.

 list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden




-- Mark J. Reed <email@hidden> _______________________________________________


There are some advantages to opening for access, but with a bit of effort this can be overcome.
So you get the same effect reading and writing without opening for access.
As for reading you can read the whole file or bits of the file at a time if this is what you want.
Thus;


read file f from 1 to 100 using delimiters "thisword"

works fine both using open for  access or not.

Deivy Petrescu
email@hidden



_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden
References: 
 >Re: open for access file (From: Shane Stanley <email@hidden>)
 >Re: open for access file (From: "Stockly, Ed" <email@hidden>)
 >Re: open for access file (From: "Mark J. Reed" <email@hidden>)

  • Prev by Date: Re: open for access file
  • Next by Date: Re: open for access file
  • Previous by thread: Re: open for access file
  • Next by thread: Re: open for access file
  • Index(es):
    • Date
    • Thread