Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!hellgate.utah.edu!cs.utexas.edu!uwm.edu!uakari.primate.wisc.edu!ginosko!uunet!mcsun!sunic!tut!ra!chyde!ts From: ts@chyde.uwasa.fi (Timo Salmi LASK) Newsgroups: comp.lang.pascal Subject: Is file open? (Was Re: writing a disk file to a full disk) Summary: The trickiest part is missing Message-ID: <828@chyde.uwasa.fi> Date: 3 Oct 89 19:39:22 GMT References: <8909281232.aa13997@BONNIE.ICS.UCI.EDU> <697@thor.wright.EDU> Reply-To: ts@chyde.uwasa.fi (Timo Salmi LASK) Organization: U of Vaasa, Finland Lines: 25 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