home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / pascal / 7439 < prev    next >
Encoding:
Text File  |  1992-12-13  |  1.4 KB  |  31 lines

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