home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / unix / question / 10267 < prev    next >
Encoding:
Text File  |  1992-08-21  |  1.9 KB  |  42 lines

  1. Newsgroups: comp.unix.questions
  2. Path: sparky!uunet!stanford.edu!ames!data.nas.nasa.gov!ace!jns
  3. From: jns@ace.nas.nasa.gov (John N. Stewart)
  4. Subject: Re: How do I tell if a file is open for writing?
  5. References: <1992Aug20.132711.4783@news.eng.convex.com> <1992Aug20.234643.27829@nas.nasa.gov> <1992Aug21.000621.22271@news.eng.convex.com>
  6. Sender: news@nas.nasa.gov (News Administrator)
  7. Organization: NAS, NASA Ames Research Center, Moffett Field, CA
  8. Date: Fri, 21 Aug 92 16:34:21 GMT
  9. Message-ID: <1992Aug21.163421.8399@nas.nasa.gov>
  10. Lines: 30
  11.  
  12. In article <1992Aug21.000621.22271@news.eng.convex.com> tchrist@convex.COM (Tom Christiansen) writes:
  13. >From the keyboard of jns@ace.nas.nasa.gov (John N. Stewart):
  14. >:I would use the time of last access on a stat command, if you are
  15. >:trying to do this in CSH you've got some problems. DO IT IN PERL!
  16. >:
  17. >:My $0.02 worth -- and since it is as difficult as Tom C. says, and he
  18. >:is a Perly guy, I hope he agrees :)
  19. >
  20. >Um, I'm not sure kernel dives are best done in Perl.  I've done it (Oh, 
  21. >yes: I admit it -- I've done just about everything in Perl :-), but it
  22. >wasn't particular fast, fun, or fulfilling.  Nlisting the kernel is not
  23. >quick in any event.  I'd get Bernstein's tool and use that rather than
  24. >recreating the wheel, although I'd likely embedded it perhaps in a sh
  25. >script, perhaps in a Perl program.
  26.  
  27.  
  28. Ok, I was misunderstood. Nlisting the kernel is too slow for most people, 
  29. instead what I was suggesting was that that stat command can give last mod
  30. time and that would simplify matters a certain amount. Given a certain time
  31. delay, if that has expired, then the last write has completed etc. Doing in
  32. that in Perl is simple since the stat command is available.
  33.  
  34. Of course, if kernel stats are what is really necessary, then ... I would
  35. suggest creating a lock file.
  36.  
  37. --
  38. John Stewart (Ace)
  39. CSS/DSS
  40. NASA Ames Research Center
  41. (415) 604-4345
  42.