Path: utzoo!utgpu!news-server.csri.toronto.edu!me!mipscan Newsgroups: comp.lang.pascal From: rio@tension.me.utoronto.ca (Oscar del Rio) Subject: Re: Blockread/write problem Message-ID: <90Aug29.130557edt.64@tension.me.utoronto.ca> Organization: University of Toronto, Mechanical Engineering, Canada References: <24316@adm.BRL.MIL> <1990Aug29.123053.17412@ux1.cso.uiuc.edu> Date: 29 Aug 90 17:07:34 GMT In article <1990Aug29.123053.17412@ux1.cso.uiuc.edu> dslg0849@uxa.cso.uiuc.edu (Daniel S. Lewart) writes: > >S89405079%HSEPM1.HSE.NL@vm1.nodak.edu writes: > >>2. When I reset a read-only file, why does TurboPascal then say that it is >> impossible to open the file<> > >My guess is that this is an 'undocumented feature' (aka bug). > >Daniel Lewart No. It is not a bug and it is documented in the manuals. By default, when you open a file (with reset) TP tries to open it as a Read/Write file, i.e., you can read it and you can write to it. Obviously, if the file is a read-only one, TP reports the error. There is a variable called FileMode that TP checks when opening a file. If you know that you will open the file only for reading, you can set FileMode:=0 before trying to open it. By default, FileMode=2 (read/write). Oscar.