home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / pascal / 7481 < prev    next >
Encoding:
Internet Message Format  |  1992-12-15  |  2.5 KB

  1. Path: sparky!uunet!usc!enterpoop.mit.edu!eru.mt.luth.se!lunic!sunic!dkuug!diku!ballerup
  2. From: ballerup@diku.dk (Per Goetterup)
  3. Newsgroups: comp.lang.pascal
  4. Subject: Re: TP's reset on read-only files
  5. Message-ID: <1992Dec15.130511.20894@odin.diku.dk>
  6. Date: 15 Dec 92 13:05:11 GMT
  7. References: <1992Dec12.214246.50@newton.hartwick.edu> <1992Dec14.022920.4467@uwasa.fi>
  8. Sender: ballerup@ask.diku.dk
  9. Organization: Department of Computer Science, U of Copenhagen
  10. Lines: 43
  11.  
  12. ts@uwasa.fi (Timo Salmi) writes:
  13.  
  14. >In article <1992Dec12.214246.50@newton.hartwick.edu> wisanr@newton.hartwick.edu writes:
  15. >>I've been astonished to discover that TP's reset procedure can't open a
  16. >>read-only file ex@|cept as a text file.  This appears to be true of
  17.  
  18. >Sorry.  This claim just is not true.
  19.  
  20. >>The only work-around I've found is to change the attribute, open and
  21. >>read the file, close it, and put it back to read-only.  I don't like it because
  22.  
  23. >Not necessary.
  24.  
  25. >>Now, what?
  26.  
  27. >Simple:
  28. >FileMode := 0;
  29.  
  30. This only allows read access to the file. If you want to modify it (write into
  31. it), then you'll have to go the long way - changing the attributes and so on.
  32.  
  33. Now somebody might argue that a file that's to be modified shouldn't be read-
  34. only, but what if you're updating something in a file, maintained by your
  35. program but not to be modified (or erased) by the user. It would be natural to
  36. keep that file readonly, but you still have to modify it, thus the work-around.
  37.  
  38.      Code on...
  39.  
  40.       Per.
  41. --
  42.  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
  43. | Per Goetterup, Student, DIKU                 InterNet: ballerup@ask.diku.dk |
  44. |                                                      pgoetter@nyx.cs.du.edu |
  45. | FidoNet: 2:231/91.10    -or-      Per.Goetterup@p10.f91.n231.z2.fidonet.org |
  46. |                                                                             |
  47. | DIKU is the department of Computer Science at the University of Copenhagen. |
  48. |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
  49. | The most merciful thing in the world I think, is the inability of the human |
  50. | mind to corrolate all its contents...              - H.P. Lovecraft, 1926 - |
  51.  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
  52. "...Gothic horror shades the dreams, kaleidoscope of what a nightmare means..."
  53.                                   ('Crash Course in Seduction', A Split-Second)
  54. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  55.