Re: "End of file error"
Re: "End of file error"
- Subject: Re: "End of file error"
- From: nellA hciR <email@hidden>
- Date: Fri, 29 Dec 2000 11:22:34 -0900
-- this may help you
set fRef to open for access file ,
"pb0:desktop folder:test" with write permission
set buff to read fRef
write (return & "next line") to fRef starting at ((get eof fRef) + 1)
close access fRef
-- hcir
My script needs to be able to read from and write to a simple text file. I
>
open the file for access and read the contents using:
>
>
open for access file "Hosts" of folder "Preferences" of folder "System
>
Folder" of startup disk
>
copy the result to thehostsfile
>
read thehostsfile
>
>
The wierd bit is once the script runs once ( My script also writes to the
>
file and sets the eof the file) and try to run again I get "Finder got an
>
error:End of file error".
>
>
The wierd bit is if I open the text file in simpletext, type a space, delete
>
the space and save it, then the script will run fine again. Once. If I
>
save the script as an application, it never works. Always gets "End of file
>
error"