Caveats for removing /cygdrive prefix?

Warren Young warren@etr-usa.com
Tue Jul 22 15:58:00 GMT 2014


On 7/22/2014 05:38, Matt D. wrote:
> I've always used Cygwin's fstab /cygdrive default but I'm growing tired
> of always typing it out; msys's simple "/a" "/c" "/d" prefix for drive
> letters always seemed closer to home while on a Windows machine.

It's not clear to me from your message if you know this, but it's easy 
to get that behavior on Cygwin.  Just change the cygdrive line in 
/etc/fstab to:

     none / cygdrive binary,posix=0,user 0 0

I've been running this way for many years now, and I have never traced 
any problem I've had with Cygwin to this practice.

> The only problem I've encountered is a borked ls display when an actual
> folder "a", "b", etc., appears in the Cygwin root folder

I can't think of a good justification for creating single-letter folder 
names at the top level of a volume, so this seems like a problem that 
isn't likely to come up.

> the inability to enumerate drive with "ls /cygdrive".

I think that's actually a feature.  Notice that "ls /" also doesn't 
include "cygdrive".  If it did, you'd get duplicate entries in "find /" 
commands, the locate(1) DB, etc.

> Also, it would be nice if doing a directory list on /cygdrive was a
> hard-coded operation, to preserve this functionality.

That causes duplicate entries when you use the fstab solution.

For example, "find / -name sh.exe" would turn up both /bin/sh.exe and 
/c/cygwin/bin/sh.exe.

If the Cygwin filesystem naming scheme were perfect, you could say "find 
-name sh" and get the same results.  And then if you demand that 
find(1)'s readdir() calls include both sh and sh.exe entries to fix 
this, now you've created another duplicate entry problem.

The Windows to POSIX translation will always be imperfect.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list