home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / unix / shell / 3121 < prev    next >
Encoding:
Text File  |  1992-07-24  |  2.7 KB  |  68 lines

  1. Newsgroups: comp.unix.shell
  2. Path: sparky!uunet!ftpbox!motsrd!white!sapphire.rtsg.mot.com!motcid!yorton
  3. From: yorton@turtle11.rtsg.mot.com (James J. Yorton)
  4. Subject: Re: noclobber
  5. Message-ID: <1992Jul24.140107.8004@rtsg.mot.com>
  6. Sender: news@rtsg.mot.com
  7. Nntp-Posting-Host: turtle11
  8. Reply-To: yorton@rtsg.mot.com
  9. Organization: Motorola Inc., Cellular Infrastructure Group
  10. References: <1992Jul21.070212.16485@gbrmpa.gov.au> <1992Jul22.014834.1384@jpradley.jpr.com> <1992Jul23.191928.4948@walter.bellcore.com> <91773@bu.edu>
  11. Date: Fri, 24 Jul 1992 14:01:07 GMT
  12. Lines: 54
  13.  
  14. In article <91773@bu.edu>, tesco@bumetb.bu.edu (Dances With Babes) writes:
  15. |> Does anyone know if the "set -o noclobber" command is atomic?
  16. |> I'm trying to implement a semaphore in ksh, and this would be a good way,
  17. |> provided it's atomic (that it,  no two people can create the file at the same time).
  18. |> 
  19. |> If it's not atomic, anyone know of a good way
  20. |> to implement a semaphore using ksh?
  21. |> 
  22. |> 
  23. |> -tesco
  24.  
  25. Sorry I don't have the answer to your specific question.
  26.  
  27. But before people go off and try doing things with "set -o noclobber",
  28. I wanted to let people know there is a bug with "set -o noclobber"
  29. in the latest release of ksh from the Toolchest (ksh88g), at least
  30. on some systems, specifically mine (Sun OS 4.1.1).
  31.  
  32. In a phrase, it doesn't work.  It's as if you have noclobber
  33. disabled, even though set -o shows it's enabled, so overwriting a
  34. file with > redirection silently overwrites that file.
  35.  
  36. I passed my findings on to David Korn and here was his response:
  37.  
  38. : Date: Wed, 8 Apr 92 23:39:33 EDT
  39. : This is a serious problem.  The code uses POSIX style
  40. : macros to test file attributes.  However, since the type
  41. : field for regular files can be zero, my code can't
  42. : distinguish between files that don't exist and regular
  43. : files.
  44. : I will have to put together an 'h' point release for
  45. : release very soon.
  46. : Thanks for reporting the problem.  It looks as if
  47. : most people do not use noclobber or else the problem
  48. : would have been reported sooner.
  49.  
  50. If you're not running ksh88g you should be OK as the problem
  51. is NOT present in previous releases of ksh from the Toolchest.
  52. The Toolchest says the latest release is still 88g and said
  53. ksh-92 is coming.  No mention of ksh88h yet.  If anyone knows
  54. what's going on with 88h, let me know or post it.  Thanks.
  55.  
  56. --------------------------------------+---------------------------------------
  57. Jim Yorton                            | Telephone:  +1 708-632-6695
  58. Motorola Inc., General Systems Sector |
  59. Cellular Infrastructure Group         | internet:  yorton@rtsg.mot.com
  60. 1501 - West Shure Drive               | uucp:      ...!uunet!motcid!yorton
  61. Mail Drop:  IL27-3227                 |
  62. Arlington Heights, IL  60004          |
  63. USA                                   |
  64.