Re: Read - testing for EOF
Re: Read - testing for EOF
- Subject: Re: Read - testing for EOF
- From: Chap Harrison <email@hidden>
- Date: Tue, 20 Jan 2004 09:20:46 -0600
Alex,
Thank you for the two doc links! A godsend....
Haven't got a code snippet handy to demonstrate the EOF bug (?) I
described. The repetition of the final record was my bug, but the
infinite loop at EOF involved a situation similar to what you described
below. When I have a little time I'll try and post an example
reproducing the behavior.
Chap
repeat
try
set chunk to read R until myDelim
[ process read chunk here ]
on error
[ do some cleanup here if needed ]
exit repeat
end try
end repeat
But yes, while preparing my reply yesterday, I encountered behaviors
similar to the ones you are describing.
As it appeared very elusive, I wasn't sure if it was me or
AppleScript, so I wanted to investigate a bit further; but I wouldn't
leave you alone...
Here is a case I can reproduce:
1. write sequence "aaaLbbbLcccSdddLeeeLfffLS" to
a file (with no ending CR or LF), where L in fact
is ASCII number 163 and S is ASCII number 164.
2. run a script similar to the above, where myDelim
is set to ASCII character 163
Result: an endless loop, with the last pseudo-L read ad infinitum.
Should you have them at hand, could you post minimal sample data/code
producing similar effects?
_______________________________________________
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.