Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!dogie.macc.wisc.edu!indri!lll-winken!uunet!mcvax!kth!draken!tut!santra!chyde!ts From: ts@chyde.uwasa.fi (Timo Salmi LASK) Newsgroups: comp.lang.pascal Subject: Re: Drive not ready message Message-ID: <469@chyde.uwasa.fi> Date: 26 Apr 89 18:56:18 GMT References: <2215@botter.cs.vu.nl> Reply-To: ts@chyde.uwasa.fi (Timo Salmi LASK) Organization: University of Vaasa, Finland Lines: 24 In article <2215@botter.cs.vu.nl> cjveenm@cs.vu.nl () writes: > Question: >When you try to open a file for reading or writing and that file is >on a drive which isn't ready yet, you will get a message that tells you >about your mistake. >Using Turbo Pascal 3 this will happen after the RESET(file) or >REWRITE(file), but in TP4 it won't. At least when I am doing so. >Why is that? Now I do not know why it is so, but what you should do is to check for the IOResult yourself in your program at reset or rewrite time: FileMode := 0; {to allow testing even protected files} {I-} reset(myfile); {I+} result := IOResult; If the result = 152 then the drive is not ready. Simple as that. (Tested with a Turbo 5.0 program). ................................................................... Prof. Timo Salmi School of Business Studies, University of Vaasa, SF-65101, Finland Internet: ts@chyde.uwasa.fi Funet: vakk::salmi Bitnet: salmi@finfun