Read file bug?
Read file bug?
- Subject: Read file bug?
- From: Timothy Bates <email@hidden>
- Date: Thu, 17 Apr 2003 14:13:07 +1000
Hi there,
If I open a file and read until the end of a line, I expect to eventually
error as we hit the eof.
This code, however, loops forever. Bug or misunderstanding. How does one
know that the last line has been read?
(the "posit" bit won't compile if you are not using smile. I use it as a
textual progress indicator)
property pPathToDataFile : "path:to:a:text:file"
set f to open for access file pPathToDataFile
set targetString to "not in this file"
set n to 1
set nextN to 1
repeat
set a to read f until ASCII character 10
if n > nextN then
postit n & "" & a as string
set nextN to n + 50
end if
set n to n + 1
end repeat
close access file pPathToDataFile
Dr Timothy Bates <
mailto:email@hidden>
Macquarie Centre for Cognitive Science (MACCS)
Macquarie University
Ph 61 (2) 9850 8623
Fx 61 (2) 9850 6059
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.