Re: Standard Additions 'read' command - basic questions
Re: Standard Additions 'read' command - basic questions
- Subject: Re: Standard Additions 'read' command - basic questions
- From: Emmanuel <email@hidden>
- Date: Mon, 19 Jan 2004 08:46:46 +0100
At 11:35 PM -0600 18/01/04, Chap Harrison wrote:
>
The first thing I noticed was that a single invocation of 'read' appears to return the entire *file* as a list!! Is this how 'read' is supposed to work?
>
>
If so, are there any limits as to the length of a list?
>
>
The second problem was that 'read' doesn't care for my high-end delimiters:
>
>
set foo to (read fid using delimiter (ASCII character 254)) -- also tried 255
>
>
foo is a list containing one string, which is the contents of the entire file, with my oddball delimiters intact.
You're just saying that "read" works as it should!
Check carefully the dictionary. What you may want is "read ... until". Otherwise, when you say "read ... using delimiter", you get a list of strings, the result of chopping the whole original file into pieces at the locations of the delimiter.
-----------------
set f to "" & (path to "temp") & "(make new name)"
open for access file f with write permission
write "hello" & (ASCII character of 254) & "world" to file f
close access file f
read f using delimiter (ASCII character of 254)
-- {"hello", "world"}
-----------------
Emmanuel
_______________________________________________
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.