Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Fri, 17 Sep 2004 11:16:38 +0200 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: Problem with cat under bash shell Message-ID: <20040917091638.GA9638@cygbert.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <20040916103634 DOT GD17670 AT cygbert DOT vinschen DOT de> <20040916120158 DOT 85111 DOT qmail AT web90001 DOT mail DOT scd DOT yahoo DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040916120158.85111.qmail@web90001.mail.scd.yahoo.com> User-Agent: Mutt/1.4.2i 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 http://cygwin.com/snapshots/ Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Project Co-Leader mailto:cygwin AT cygwin DOT com Red Hat, Inc. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/