delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2003/09/01/17:14:42

From: "Tim Van Holder" <tim DOT van DOT holder AT pandora DOT be>
To: <djgpp-workers AT delorie DOT com>
Subject: Re: /dev/c - c: or c:/ ?
Date: Mon, 1 Sep 2003 22:50:41 +0200
Message-ID: <002a01c370ca$b51801e0$2202a8c0@dualzastai>
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook, Build 10.0.4510
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Importance: Normal
In-Reply-To: <3405-Mon01Sep2003191913+0300-eliz@elta.co.il>
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

> > From: "Tim Van Holder" <tim DOT van DOT holder AT pandora DOT be>
> > Date: Mon, 1 Sep 2003 08:02:46 +0200
> > 
> > > What other way is there to express "c:" with the /dev/x notation?
> > 
> > Should there be one?
> 
> If there's a reason to disallow it, let's hear it.  If not, I'd
> generally advise to refrain from gratuitous changes.

How about simple shell sanity?  Shell scripts may consider
$dir and $dir/. to be interchangeable (and I wouldn't be surprised
if POSIX mandated this), which would not necessarily be true in
our case ('c:' versus 'c:/.' if $dir is /dev/c).

> > The /dev/xxx notation is there for POSIX support
> 
> No, it's for programs and shell scripts which believe that every
> absolute file name begins with a slash.

Which is the POSIX way of thinking.  Same difference.

> > again, does this mean that 'cd /dev/c' ends you in
> > '/dev/c/Documents And Settings/Foo/Desktop'?  If so, that's one
> > (good) reason for making /dev/c map to c:/.
> > After all, unlike Cygwin (as far as I know), we still allow 
> DOS-style
> > paths, so users can still use c: if they need it.
> 
> Users can do that, but we introduced /dev/x for shell scripts.  What
> if a shell script does a "cd /dev/c" for some reason?

Then it will expect to be in /dev/c, not /dev/c/whatever/dir/is/current.

> I guess one important related question is what does `pwd' produce
> when the current directory is "c:/"?

c:/
bash's pwd builtin returns c:/, /dev/c, or /dev/c/ based on what you cd'd
to.


- Raw text -


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