home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / std_unix / v21 / 094 < prev    next >
Internet Message Format  |  1990-12-05  |  3KB

  1. From std-unix-request@uunet.uu.net  Sun Sep  9 01:39:58 1990
  2. Received: from cs.utexas.edu by uunet.uu.net (5.61/1.14) with SMTP 
  3.     id AA26950; Sun, 9 Sep 90 01:39:58 -0400
  4. Posted-Date: 8 Sep 90 18:01:18 GMT
  5. Received: by cs.utexas.edu (5.64/1.76) 
  6. From: think!barmar@cs.utexas.edu (Barry Margolin)
  7. Newsgroups: comp.std.unix
  8. Subject: Overwriting existing file (was Re: Query about P1003.2 'cp' utility)
  9. Message-Id: <500@usenix.ORG>
  10. References: <DJM.90Aug17151613@jolt.eng.umd.edu> <439@usenix.ORG> <496@usenix.ORG>
  11. Sender: std-unix@usenix.ORG
  12. Organization: Thinking Machines Corporation, Cambridge MA, USA
  13. X-Submissions: std-unix@uunet.uu.net
  14. Date: 8 Sep 90 18:01:18 GMT
  15. Reply-To: std-unix@uunet.uu.net
  16. To: std-unix@uunet.uu.net
  17.  
  18. From: barmar@think.uucp (Barry Margolin)
  19.  
  20. In article <496@usenix.ORG> cowan@marob.masa.com (John Cowan) writes:
  21. >The difference between unlinking before opening and opening with O_TRUNC is,
  22. >of course, that the former course of action can change the file's owner,
  23. >group, and mode settings, whereas the latter course of action cannot.
  24.  
  25. Does POSIX have the O_CREAT mode flag?
  26.  
  27. This is related to my favorite complaint as a user of an unusual NFS
  28. server.  We have Symbolics Lisp Machines that run their NFS server, and the
  29. Symbolics file system has files with version numbers.
  30.  
  31. When a client is opening an existing file for output there are two ways it
  32. can do it.  It can call the NFS Create entry, or it can call NFS Lookup
  33. followed by NFS SetAttr to set the length to 0.  These two operations have
  34. equivalent results with a Unix server (although the second requires more
  35. network operations), but the Symbolics server treats the Create operation
  36. as a request to create a new version of the file.  I thought of having
  37. SetAttr create a new version when asked to truncate to zero length, but
  38. this wouldn't help because the client already has a file handle on the
  39. previous version, and it wouldn't be correct to change the association
  40. between a file handle and the actual file (a second client might be using
  41. that file handle).
  42.  
  43. The SunOS client uses the Create method, and most of our NFS clients are
  44. Suns, so it's not a major problem.  However, Ultrix 3.1 uses the
  45. Lookup/SetAttr method.  We complained to DEC a year or two ago about this
  46. but they were unsympathetic.  The most surprising thing, to me, about this
  47. lack of sympathy is that DEC's proprietary OS, VMS, has version numbers, so
  48. I would imagine that this would be a problem for Ultrix clients using VMS
  49. servers.
  50. --
  51. Barry Margolin, Thinking Machines Corp.
  52.  
  53. barmar@think.com
  54. {uunet,harvard}!think!barmar
  55.  
  56. Volume-Number: Volume 21, Number 94
  57.  
  58.