[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: question



In article <2vrtsi$ahf@styx.uwa.edu.au>,
Joseph Turner <jturner@tartarus.uwa.edu.au> wrote:
> 
>   Hi , I was wondering what the command "FLUSH" does on prodos. I came 
> across it when I was scanning a prodos disk.

I'm assuming you actually mean the BASIC.SYSTEM "FLUSH" command.

There are two ways you can use this:

1. PRINT D$;"FLUSH filename"  or  PRINT D$;"FLUSH ";F$

This tells BASIC.SYSTEM to write out any data which has been buffered
for that file, and not written yet.  It also causes the directory
entries to be updated as if you had closed the file.

2. PRINT D$;"FLUSH"

Basically the same as above, but it flushes ALL open files.


The FLUSH command is only useful if you have one or more opened text
files and are writing to them.  It is often used in situations where a
file will be open for a long time, and you want to ensure that the
disk is in a reasonable state during a long pause between writes.

FLUSH is similar in effect to CLOSEing and file, OPENing it again, and
seeking back to the position you were up to previously.


There is also a FLUSH call in the ProDOS Machine Language Interface,
which performs the same function (at a lower level) - it is used
internally by BASIC.SYSTEM when you use its FLUSH command.  It can
also be used by machine language programs for the same purpose as
above (though it can be used for all types of files).
-- 
David Empson
dempson@actrix.gen.nz
Snail mail: P.O. Box 27-103, Wellington, New Zealand