Re: (9.2.2) Reading until the end of a file
Re: (9.2.2) Reading until the end of a file
- Subject: Re: (9.2.2) Reading until the end of a file
- From: Shane Stanley <email@hidden>
- Date: Tue, 03 Sep 2002 21:44:18 +1000
On 3/9/02 9:28 PM +1000, Steve Thompson, email@hidden, wrote:
>
my script says:
>
>
get eof file "Steve:Desktop Folder:Query Results"
>
--> 322.0
>
>
read file "Steve:Desktop Folder:Query Results" until 322.0
>
--> "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
>
<approvedorders>
>
<ordercode orderid='ORD000426'>
>
<orderdocunid>FDEDDCCBFD95BE7880256BC60046D4CE</orderdocunid>
>
<publication>Aire Valley Target</publication>
>
<insertiondate>3"
>
>
>
Get eof returns the correct file size, but read file <xxx> until <eof value>
>
doesn't work. It doesn't seem to return the file to it's eof. Even if Get
>
eof erroneously returned the file size, that would still be greater that the
>
amount of text in the file.
>
>
Can anyone tell me the correct way to read an entire file in to a variable
>
in one go?
Just use:
read file pathToFile
No need to specify anything else.
>
Or tell me why this doesn't seem to be working properly?
If you need to specify the number of bytes to read, use the "for" parameter.
The "until" parameter reads until it hits the specified character -- in this
case "3", the first character of 322.
--
Shane Stanley, email@hidden
_______________________________________________
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.