4 ms·
Cygwin handles the drive letter situation using a special directory under it's root called cygdrive. Each drive letter is exposed as a sub directory of it so in
by smhenderson 10y ago
Cygwin handles the drive letter situation using a special directory under it's root called cygdrive. Each drive letter is exposed as a sub directory of it so in your example the path is:
/cygdrive/c/foo/bar.txt
Not saying it's any prettier but that's how they do it. Not sure how they do this but thankfully it doesn't nest recursively. Say you install cygwin on your C: drive. If you do "cd /cygdrive/c/cygwin" and then ls you'll see cygdrive as a directory entry but if you cd into it and ls again there are no drive letters. The only place the drive letter directories are exposed is directly under /cygdrive.
- kazinator 10y agoI seem to recall that once upon a time, only the /cygdrive convention worked in Cygwin. But for years now, Cygwin has supported supported drive letter prefixes, as in c:/foo/bar.txt. Thus, effectively, /cygdrive/c can be regarded as a legacy hack. Sort of. If you do "cd c:" you end up with "/cygdrive/c" as your current working directory. Backslashes work fine, too; try "ls c:\\temp".
- smhenderson 10y agoHey, thanks, I did not know that and I use cygwin a lot. I guess that explains why my comment was voted down.