home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.pascal
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!torn!news.ccs.queensu.ca!slip203.telnet1.QueensU.CA!dmurdoch
- From: dmurdoch@mast.queensu.ca (Duncan Murdoch)
- Subject: Re: TP's reset on read-only files
- Message-ID: <dmurdoch.230.724301883@mast.queensu.ca>
- Lines: 19
- Sender: news@knot.ccs.queensu.ca (Netnews control)
- Organization: Queen's University
- References: <1992Dec12.214246.50@newton.hartwick.edu>
- Date: Mon, 14 Dec 1992 02:58:04 GMT
-
- In article <1992Dec12.214246.50@newton.hartwick.edu> wisanr@newton.hartwick.edu writes:
- >
- >I've been astonished to discover that TP's reset procedure can't open a
- >read-only file ex@|cept as a text file. This appears to be true of
- >every version since TP1. If it weren't clearly documented I'd call it a bug:
- >reset opens a text file for input and any other kind of file for
- >input and output. In consequence, DOS will reject an attempt to reset a file
- >with attribute read-only.
-
- No, Reset opens other files with mode FileMode. Change FileMode to 0 if you
- want read-only access to a binary file. Better yet, don't use binary files
- at all. Use streams, and specify the open mode when you open them. Streams
- are at least as fast and much more flexible than binary files in TP. (The
- TDOSStream is about identical to an untyped binary file. The TBufStream can
- be much faster when buffering helps; sometimes it's slower, when
- buffering hurts.)
-
- Duncan Murdoch
- dmurdoch@mast.queensu.ca
-