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 Message-ID: <20040916120158.85111.qmail@web90001.mail.scd.yahoo.com> Date: Thu, 16 Sep 2004 13:01:58 +0100 (BST) From: =?iso-8859-1?q?Lionel=20Barnett?= Reply-To: cygwin AT cygwin DOT com Subject: Re: Problem with cat under bash shell To: cygwin AT cygwin DOT com In-Reply-To: <20040916103634.GD17670@cygbert.vinschen.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes --- Corinna Vinschen wrote: > On Sep 16 10:47, Lionel Barnett wrote: > > --- Corinna Vinschen wrote: > > > > /netrel/src/cygwin-1.5.11-1/winsup/cygwin/fhandler.cc:263 > windows > > > error > > > > 59 > > > > 756 122627 [main] cat 2668 geterrno_from_win_error: unknown > > > windows > > > > error 59, setting errno to 13 > > > > > > That looks really weird. Did you notice that win32 error 59 > means > > > "An unexpected network error occurred." ? > > > > Yes, I was aware of that. > > > > > Does that give a hint to you? > > > > Um, not really... except that it appears the problem doesn't arise > if > > /tmp is accessed locally rather than over the network. However, I > > constantly read/write/execute files all over the network via Cygwin > > tools and have not encountered any problems previously. Is there > > something special about /tmp that I am not aware of? > > 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. Regards, ===== Lionel B ___________________________________________________________ALL-NEW Yahoo! Messenger - all new features - even more fun! http://uk.messenger.yahoo.com -- 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/