[comp.lang.pascal] Is file open?

ts@chyde.uwasa.fi (Timo Salmi LASK) (10/04/89)

In article <697@thor.wright.EDU> demon@thor.wright.edu writes:
:>space is left before you do a write.  In addition, you can keep track of
:>whether a file is open by doing a check on the file type record.
:>    CONST
:>	fmClosed = $D7B0 (file is closed)
:>		fmInput = $D7B1 (file is text and reset)
:>		fmOutPt = $D7B2 (file is text and rewritten)
:>These can be accessed in the mode field of the filevar record:
:>	current_status := filevar.mode
:>and then checking it against the CONST values.
:>							Brett Kottmann

Unfortunately it is not quite this simple as put forward here.  This
is because the filevar must be declared correctly, which is the
trickiest part of the whole exercise.  This can be done by first
declaring the filePOINTER.  Then the fileVAR record must be declared
to reside at the same absolute address as the filepointer.  Only
then will this work.  Turbo Pascal 4.0 and 5.0 manuals do not give
adequate information on this feature.  (Corrections are welcome; but
please, Brett, no personal attacks.)

...................................................................
Prof. Timo Salmi                                (Site 128.214.12.3)
School of Business Studies, University of Vaasa, SF-65101, Finland
Internet: ts@chyde.uwasa.fi Funet: vakk::salmi Bitnet: salmi@finfun