Discussion:
How does cygwin map / to c:/cygwin?
Jeff Perry
2002-09-27 22:44:03 UTC
Permalink
I am very confused about how cygwin maps its root to the c:/cygwin
directory. I'm also not sure what /cygdrive is.

When I type gvim /etc/passwd from bash, gvim comes up with an empty file
called passwd in c:/etc (which doesn't exist). If I try to write this file,
gvim fails, which, of course, it should. (The gvim I'm using is the one
compiled for NT).

Can someone tell me why this happens?

Also, when I try to tab-expand /cygdrive/c/..., bash can never expand the
files. For example, if I type
$ cd /cygdrive/c/winn<tab>, bash cannot complete the 't' and instead beeps.
But if I complete it for bash by adding the t and the pressing <return>,
bash will cd me to the c:/winnt directory.

Can someone tell me why this is true?

Jeff


--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
Jeremy Hetzler
2002-09-28 06:22:52 UTC
Permalink
Post by Jeff Perry
I am very confused about how cygwin maps its root to the c:/cygwin
directory. I'm also not sure what /cygdrive is.
"c:\cygwin" is mounted as "/". Your Windows drives (c:, d:) are mounted
under /cygdrive (/cygdrive/c, /cygdrive/d).
Post by Jeff Perry
When I type gvim /etc/passwd from bash, gvim comes up with an empty file
called passwd in c:/etc (which doesn't exist). If I try to write this file,
gvim fails, which, of course, it should. (The gvim I'm using is the one
compiled for NT).
This is correct behavior. Only programs compiled against cygwin1.dll are
aware of Cygwin-style paths. vim is available for Cygwin, maybe gvim is as
well (try http://cygwin.com/packages/ , try Google, try searching the
mailing list).
Post by Jeff Perry
Also, when I try to tab-expand /cygdrive/c/..., bash can never expand the
files. For example, if I type
$ cd /cygdrive/c/winn<tab>, bash cannot complete the 't' and instead beeps.
But if I complete it for bash by adding the t and the pressing <return>,
bash will cd me to the c:/winnt directory.
The name of the directory is WINNT, not winnt. bash will tab-complete
successfully if you give it the right name (exceptions include /dev).

Jeremy


--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
Max Bowsher
2002-09-28 16:34:42 UTC
Permalink
Post by Jeff Perry
I am very confused about how cygwin maps its root to the c:/cygwin
directory. I'm also not sure what /cygdrive is.
When I type gvim /etc/passwd from bash, gvim comes up with an empty file
called passwd in c:/etc (which doesn't exist). If I try to write this file,
gvim fails, which, of course, it should. (The gvim I'm using is the one
compiled for NT).
Can someone tell me why this happens?
The Cygwin POSIX paths come from the cygwin1.dll. So if your program hasn't been
compiled for Cygwin, it won't understand Cygwin paths.
Post by Jeff Perry
Also, when I try to tab-expand /cygdrive/c/..., bash can never expand the
files. For example, if I type
$ cd /cygdrive/c/winn<tab>, bash cannot complete the 't' and instead beeps.
But if I complete it for bash by adding the t and the pressing <return>,
bash will cd me to the c:/winnt directory.
Can someone tell me why this is true?
Sounds like case clashes. See the readline info pages and add "set
completion-ignore-case On" to your global inputrc file or ~/.inputrc.

Max.


--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
John Carlyle- Clarke
2002-09-30 16:15:12 UTC
Permalink
-----Original Message-----
Sent: 27 September 2002 23:44
Subject: How does cygwin map / to c:/cygwin?
When I type gvim /etc/passwd from bash, gvim comes up with an
empty file
called passwd in c:/etc (which doesn't exist). If I try to
write this file,
gvim fails, which, of course, it should. (The gvim I'm using
is the one compiled for NT).
Other have explained why: here is my solution. Put this in your ~/.bashrc:

function gvim { gvim.bat $(cygpath -w $*) ; }



--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/

Loading...