This is the mail archive of the
mailing list for the Cygwin project.
Re: Problem with cat under bash shell
On Sep 16 13:01, Lionel Barnett wrote:
> --- Corinna Vinschen <firstname.lastname@example.org> 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 http://cygwin.com/snapshots/
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Project Co-Leader mailto:email@example.com
Red Hat, Inc.
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html