delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/09/16/06:36:11

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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: Thu, 16 Sep 2004 12:36:34 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Problem with cat under bash shell
Message-ID: <20040916103634.GD17670@cygbert.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <20040916092623 DOT GC17670 AT cygbert DOT vinschen DOT de> <20040916094708 DOT 77372 DOT qmail AT web90008 DOT mail DOT scd DOT yahoo DOT com>
Mime-Version: 1.0
In-Reply-To: <20040916094708.77372.qmail@web90008.mail.scd.yahoo.com>
User-Agent: Mutt/1.4.2i

On Sep 16 10:47, Lionel Barnett wrote:
>  --- Corinna Vinschen <corinna-cygwin AT cygwin DOT com> 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.


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/

- Raw text -


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