tail -f, does it lock the file while it scans ?

Jerry Peek jdpeek at RODAN.ACS.SYR.EDU
Sun May 21 13:16:52 AEST 1989


In article <1623 at auspex.auspex.com> guy at auspex.auspex.com (Guy Harris) writes:
> >Does tail -f do some kind of file lock to prevent writing by another
> >proccess ??
> 
> No.

I didn't see the original article, so I apologize if someone already pointed
this out, but it seems like it's important...

I think most of the reason for *having* a "tail -f" is to be able to read a
file while another process is writing to it.  I use this all the time in cases
like:
	% some_slow_process > outputfile &
	[1] 12345
	% tail -f outputfile
	watch lines from outputfile
	as outputfile grows...
	whenever some_slow_process writes a line, I see it
I can kill the "tail -f", come back later, start it again... very nice.

--Jerry Peek; Syracuse University Academic Computing Services; Syracuse, NY
  jdpeek at rodan.acs.syr.edu, jdpeek at suvm.bitnet
  +1 315 443-3995



More information about the Comp.unix.questions mailing list