public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* tail -f <file name> locks <file name>
@ 1999-04-27 12:16 thomas
  1999-04-27 12:34 ` Chris Faylor
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: thomas @ 1999-04-27 12:16 UTC (permalink / raw)
  To: gnu-win32

This has not been the original intention of 'tail -f': This command should
enable the user
to watch the contents of a file grow. If this file is locked by the tail
command, the writing process
will run on error.

Best regards

Thomas Hirschmann



--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 16+ messages in thread
* Re: tail -f <file name> locks <file name>
@ 1999-04-27 13:28 Earnie Boyd
  1999-04-30 18:32 ` Earnie Boyd
  0 siblings, 1 reply; 16+ messages in thread
From: Earnie Boyd @ 1999-04-27 13:28 UTC (permalink / raw)
  To: thomas, gnu-win32

--- thomas@on.com wrote:
> This has not been the original intention of 'tail -f': This command should
> enable the user
> to watch the contents of a file grow. If this file is locked by the tail
> command, the writing process
> will run on error.

Interesting.  Are you mixing cygwin and non-cygwin processes?  I have a mingw32
version of tail that works as expected.

===
"Earnie Boyd" < mailto:earnie_boyd@yahoo.com >
CYGWIN RELATED HELP:
 DOCUMENTATION: < http://sourceware.cygnus.com/cygwin/docs.html >
       DLLHELP: < http://www.xraylith.wisc.edu/~khan/software/gnu-win32/ >
ARCHIVE SEARCH: < http://www.delorie.com/archives/ > OR
                < http://www.eGroups.com/list/gnu-win32/ >
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 16+ messages in thread
* Re: tail -f <file name> locks <file name>
@ 1999-04-30  7:36 Earnie Boyd
  1999-04-30  7:42 ` Eugene Kanter
  1999-04-30 18:32 ` Earnie Boyd
  0 siblings, 2 replies; 16+ messages in thread
From: Earnie Boyd @ 1999-04-30  7:36 UTC (permalink / raw)
  To: Eugene Kanter; +Cc: cygwin

--- Eugene Kanter <eugene@bgs.com> wrote:
--8<--
> Here is an example:
> 
> bash window 1:                     bash window 2:
> bash-2.02$ touch  mappfile.out
> bash-2.02$ tail -f  mappfile.out   bash $ cat > mappfile.out
> line1                              line1
> line2                              line2
>                                    ^C
>                                    bash $ rm mappfile.out
>                                    bash $ ls mappfile.out
>                                    ls: mappfile.out: No such file or
> directory
>                                    bash $ cat > mappfile.out
>                                    bash: mappfile.out: Permission denied
> 
> Is this enough for you to reproduce it?

The rm of mappfile.out in the bash 2 window has not actually removed it yet as
it is still open in the bash 1 window.  Cygwin has marked it in a table to be
removed when it gets closed but it's really not gone yet.  You then try to
create the file and the filesystem complains that it can't get rid of
mappfile.out because another process has it open so you get the "Permission
denied" error.  This is a feature of the MS OSes.

The only thing you can do in this case is to exit tail at which time cygwin
will note the closure of the file and remove it.

===
"Earnie Boyd" < mailto:earnie_boyd@yahoo.com >
CYGWIN RELATED HELP:
 DOCUMENTATION: < http://sourceware.cygnus.com/cygwin/docs.html >
       DLLHELP: < http://www.xraylith.wisc.edu/~khan/software/gnu-win32/ >
ARCHIVE SEARCH: < http://www.delorie.com/archives/ > OR
                < http://www.eGroups.com/list/gnu-win32/ >
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 16+ messages in thread
* Re: tail -f <file name> locks <file name>
@ 1999-04-30  9:12 Earnie Boyd
  1999-04-30 18:32 ` Earnie Boyd
  0 siblings, 1 reply; 16+ messages in thread
From: Earnie Boyd @ 1999-04-30  9:12 UTC (permalink / raw)
  To: Eugene Kanter; +Cc: cygwin

--- Eugene Kanter <eugene@bgs.com> wrote:
> Earnie Boyd wrote:
> > 
> > --- Eugene Kanter <eugene@bgs.com> wrote:
> > --8<--
> > > Here is an example:
> > >
> > > bash window 1:                     bash window 2:
> > > bash-2.02$ touch  mappfile.out
> > > bash-2.02$ tail -f  mappfile.out   bash $ cat > mappfile.out
> > > line1                              line1
> > > line2                              line2
> > >                                    ^C
> > >                                    bash $ rm mappfile.out
> > >                                    bash $ ls mappfile.out
> > >                                    ls: mappfile.out: No such file or
> > > directory
> > >                                    bash $ cat > mappfile.out
> > >                                    bash: mappfile.out: Permission denied
> > >
> > > Is this enough for you to reproduce it?
> > 
> > The rm of mappfile.out in the bash 2 window has not actually removed it yet
> as
> > it is still open in the bash 1 window.  Cygwin has marked it in a table to
> be
> > removed when it gets closed but it's really not gone yet.  You then try to
> > create the file and the filesystem complains that it can't get rid of
> > mappfile.out because another process has it open so you get the "Permission
> > denied" error.  This is a feature of the MS OSes.
> 
> Is there a way to overcome this "feature of the MS OSes"?

Uh, not unless you become the owner of MS. ;^)

> 
> Is there any other "tail" which does not cause this error? 
> 

Modify the source so that the file is closed when it reaches the end of file. 
Have win32 notify you when the file changes then reopen the file and seek to
the point you were and continue.  If the file is deleted then reset the
position pointers.


===
"Earnie Boyd" < mailto:earnie_boyd@yahoo.com >
CYGWIN RELATED HELP:
 DOCUMENTATION: < http://sourceware.cygnus.com/cygwin/docs.html >
       DLLHELP: < http://www.xraylith.wisc.edu/~khan/software/gnu-win32/ >
ARCHIVE SEARCH: < http://www.delorie.com/archives/ > OR
                < http://www.eGroups.com/list/gnu-win32/ >
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~1999-04-30 18:32 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-04-27 12:16 tail -f <file name> locks <file name> thomas
1999-04-27 12:34 ` Chris Faylor
1999-04-30 18:32   ` Chris Faylor
1999-04-27 14:01 ` Mumit Khan
1999-04-30  7:17   ` Eugene Kanter
1999-04-30 18:32     ` Eugene Kanter
1999-04-30 18:32   ` Mumit Khan
1999-04-30 18:32 ` thomas
1999-04-27 13:28 Earnie Boyd
1999-04-30 18:32 ` Earnie Boyd
1999-04-30  7:36 Earnie Boyd
1999-04-30  7:42 ` Eugene Kanter
1999-04-30 18:32   ` Eugene Kanter
1999-04-30 18:32 ` Earnie Boyd
1999-04-30  9:12 Earnie Boyd
1999-04-30 18:32 ` Earnie Boyd

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).