delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/04/30/12:13:14

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Message-ID: <19990430161320.1061.rocketmail@web119.yahoomail.com>
Date: Fri, 30 Apr 1999 09:13:20 -0700 (PDT)
From: Earnie Boyd <earnie_boyd AT yahoo DOT com>
Reply-To: earnie_boyd AT yahoo DOT com
Subject: Re: tail -f <file name> locks <file name>
To: Eugene Kanter <eugene AT bgs DOT com>
Cc: cygwin AT sourceware DOT cygnus DOT com
MIME-Version: 1.0

--- Eugene Kanter <eugene AT bgs DOT com> wrote:
> Earnie Boyd wrote:
> > 
> > --- Eugene Kanter <eugene AT bgs DOT 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 AT yahoo DOT 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 AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019