Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Open for access "end of file" error

I just want to see if the text of a file contains "My Magic Word". I don't need to write to the file, just read it.

Right now I have the following

*set OpenAccess to (open for access "~/Desktop/myfile.txt")*
*set theFileContents to (read OpenAccess)*
*close access OpenAccess*

theFileContents

Every time I open the file for the second time, I get an "end of file" error. I tried (set eof of OpenAccess to 0) but it says it only works with write privileges.

People all over the Net have had this question. So far, the only way that I can get the read marker back to 0 is by opening the file manually, typing a space at the beginning, erasing it, and then re-saving the file. The other way is to log out and log back in to my username. close access OpenAccess doesn't seem to reset the marker back to position 0.

Also, is there a way to recognize whether the user activated the app or the LogIn Items activated it? This could sure could simplify things.

Message was edited by: Joey Delli Gatti

Message was edited by: Joey Delli Gatti

PowerBook G4 1.67 Ghz, Mac OS X (10.5.5)

Posted on Dec 4, 2008 9:09 PM

Reply
6 replies

There are no replies.

Open for access "end of file" error

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.