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