[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: apple II and text files
<F0O@psuvm.psu.edu> writes:
> I was trying to write a program today which would read in a line of
> text and then append it to another file. What I found out seems to be
> that you can't both read and write at the same time, as if there is
> only one buffer in the apple which is used for both input and output.
> If this is true, this is bizarre! Am I doing something wrong, or do
> you have to read then close, write and close, then repeat the cycle?
> Also, how reliable is the append function? I appended some data to
> what was supposed to be a blank file, but after appending there was
> some junk at the beginning. Are there any gotchs to writing and reading
> text files?
>
> [Tim]
Firstly, what are you using, DOS 3.3 or ProDOS? I seem to remember a bug
with the DOS append command, but I'm not sure if it was fixed in
ProDOS...I would guess it has.
In answer to your question, the Apple can only deal with one open file at
a time. So, if you want to read a line and append it to another file, you
must follow the cycle you mentioned. Alternatively, you could read as
many lines as you needed to before you close the file and append to
the other one.
Hope this has been of assistance,
Kristian
___________________________________________________________________________
|
kkenn@cola.pax.tpa.com.au | "None of you exist; my sysop types all this in"
(Kristian Kennaway) |
| Apple // forever!
__________________________|________________________________________________