This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Problem with cat under bash shell

On Sep 16 13:01, Lionel Barnett wrote:
>  --- Corinna Vinschen <> wrote: 
> > I just curiously tried to reproduce the effect and it was pretty
> > simple.
> > I'm not quite sure, but it seems to be a strange interaction between
> > remote file handling under windows, coupled with the way the
> > temporary
> > file is handled by bash.
> > 
> > What bash does is this:  It opens a temporary file in /tmp which gets
> > everything you type into the here script up to the EOF.  Then it
> > duplicates the handle to become stdin for the still to be called
> > `cat'
> > process.  Next, it unlinks the file.  Unlink is implemented as
> >   
> >    h=CreateFile(FILE_FLAG_DELETE_ON_CLOSE);
> >    CloseHandle(h);
> > 
> > This should result in removing the file as soon as all open handles
> > to
> > the file are closed.  That works, but for some reason also the
> > ReadFile
> > call in cat fails as above.
> > 
> > I don't know how to fix this right now, but the workaround is simply
> > to have /tmp always be a local directory.
> Thanks for the information, Corinna. Actually, what surprises me most
> is that this issue has not been reported more frequently.

I've applied a patch to Cygwin which hopefully solves that for any sort
of remote share.  I tried this with shares on Samba, NT4, XP64 and 2K3.

Check out the next developers snapshot from


Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader
Red Hat, Inc.

Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]