Re: Read File Problems
Re: Read File Problems
- Subject: Re: Read File Problems
- From: Shane Stanley <email@hidden>
- Date: Wed, 21 Mar 2001 11:19:19 +1100
On 21/3/01 3:38 AM +1000, Richard 23, email@hidden, wrote:
>
Although faded, yellowing and in need of an update, the Scripting
>
Additions
>
Guide is pretty specific about this (and concurs with Nigel's assessment):
>
>
If you specify a reference to a file or an alias, the Read command
>
attempts to match the reference with a file previously opened with
>
the Open for Access command. If a match is found, it simply reads
>
the specified data. If no match is found, the Read command opens
>
the file, reads the specified data, then closes the file. The file
>
mark for a file opened in this fashion is always at the beginning
>
of the file.
>
>
If you specify a file reference number previously obtained with
>
the Open for Access command, the Read command reads the specified
>
data immediately.
It's not quite that simple. The example I was trying to think of before is
this:
set myString to "blah"
set myFile to choose file name
set fileRef to open for access myFile with write permission
write myString to fileRef
close access fileRef
read myFile
OMM that last read fails.
--
Shane Stanley, email@hidden