Re: Read File Problems
Re: Read File Problems
- Subject: Re: Read File Problems
- From: Paul Berkowitz <email@hidden>
- Date: Mon, 19 Mar 2001 19:27:33 -0800
On 3/19/01 5:20 PM, "Nigel Garvey" <email@hidden> wrote:
>
Interesting that "\r" string. It actually compiles as a return. I didn't
>
realise that was possible in AppleScript.
"\t" works as well: it compiles as a tab.
>
>
The 'read' command can't make lists from partial reads of files - unless
>
this has changed in AppleScript 1.6 too.(See the thread "How to use
>
delimiters in Standard Additions file read/write".) You have to modify
>
the line like this:
>
>
set theText to paragraphs of (read fileRef from fStart to fStop)
>
>
In this case, the 'read' command just gets the 600 bytes of text and
>
AppleScript itself breaks up the text at the returns.
I meant to ask a few days ago, when you pointed out that you don't need to
open for access a file just to read it. Is that fairly new, or has it always
been the case? You can even use all the various read parameters such 'for',
from' 'until', 'using delimiter', etc, without opening for access. You don't
need to open for access to get eof of a file either, in spite of what
Standard Additions dictionary says.
So -- what's the point of the 'write permission' parameter, if the _only_
thing you need to open for access for is to write to the file? If you can
read it and get eof without opening it for access, you actually only need to
open it in order to write to it, so why the special parameter 'with write
permission'?
--
Paul Berkowitz