delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/12/27/11:17:51

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-workers-bounces using -f
From: sandmann AT clio DOT rice DOT edu (Charles Sandmann)
Message-Id: <10112271619.AA27383@clio.rice.edu>
Subject: Re: UNC examples
To: eliz AT is DOT elta DOT co DOT il (Eli Zaretskii)
Date: Thu, 27 Dec 2001 10:19:31 -0600 (CST)
Cc: tim DOT van DOT holder AT pandora DOT be (Tim Van Holder), djgpp-workers AT delorie DOT com
In-Reply-To: <Pine.SUN.3.91.1011227175647.22136D-100000@is> from "Eli Zaretskii" at Dec 27, 2001 06:03:59 PM
X-Mailer: ELM [version 2.5 PL2]
Mime-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> > So, the glob routines can see the files, but ls can't stat them.
> 
> stat is one of the functions that depends on the drive being explicit 
> after a call to _fixpath.  It needs that for the st_dev member.  You may 
> wish to look at what _truename returns for a UNC as well.

Yes, we would have to change fixpath.  The drive (st_dev) would just
be bogus - probably / or \ would be OK.

> In addition, I think we collapse multiple slashes into a single slash, 
> so the leading double slash might be munged by that.  

Right, this would need to be disabled only for the first double slash -
treat it like a drive letter.  Need to handle this specially anyway
to avoid adding the drive letter.

> `ls' converts all 
> backslashes to forward slashes (see ls-msdos.c in the ported sources), 

This isn't a problem - for example:

C:\>dir "//cws333/d$/djgpp"
 Volume in drive \\cws333\d$ has no label.
 ...(correct results)

So Windows is perfectly happy with forward slashes.

It's interesting - if you ask cmd.exe for the "drive" of a UNC bat file
it gives you "\\" instead of "D:"  (a bug, should give entire share ...)

- Raw text -


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