• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Read - testing for EOF
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Read - testing for EOF (From: Chap Harrison <email@hidden>)
 >Re: Read - testing for EOF (From: Axel Luttgens <email@hidden>)

  • Prev by Date: Re: ASCII vs. MacRoman (was Re: Standard Additions 'read' command - basic questions)
  • Next by Date: Re: SV: Processing files in nested folders
  • Previous by thread: Re: Read - testing for EOF
  • Next by thread: Setting the due date of an existing task in Entourage to 'no due date'
  • Index(es):
    • Date
    • Thread