From 6e16a3169fbe7c09d86d398be1a05f7e7f3ee3ad Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Fri, 5 Sep 2014 19:40:39 +0000 Subject: [PATCH] * pathnames.xml (cygdrive): Add /proc/cygdrive description. --- winsup/doc/ChangeLog | 4 ++++ winsup/doc/pathnames.xml | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/winsup/doc/ChangeLog b/winsup/doc/ChangeLog index 362af7a4b..19f4d3ad5 100644 --- a/winsup/doc/ChangeLog +++ b/winsup/doc/ChangeLog @@ -1,3 +1,7 @@ +2014-09-05 Corinna Vinschen + + * pathnames.xml (cygdrive): Add /proc/cygdrive description. + 2014-09-03 Corinna Vinschen * utils.xml (setfacl): Align documentation to help text in setfacl. diff --git a/winsup/doc/pathnames.xml b/winsup/doc/pathnames.xml index b694c640a..412c98f43 100644 --- a/winsup/doc/pathnames.xml +++ b/winsup/doc/pathnames.xml @@ -355,6 +355,25 @@ the cygdrive prefix, use a distinct path prefix: D: /mnt/d somefs text 0 0 +To simplify scripting, Cygwin also provides a +/proc/cygdrive symlink, which allows to use a fixed path +in scripts, even if the actual cygdrive prefix has been changed, or is different +between different users. So, in scripts, conveniently use the +/proc/cygdrive symlink to successfully access files +independently from the current cygdrive prefix: + + + $ mount -p + Prefix Type Flags + /mnt user binmode + $ cat > x.sh <<EOF + cd /proc/cygdrive/c/Windows/System32/Drivers/etc + ls -l hosts + EOF + $ sh -c ./x.sh + -rwxrwx---+ 1 SYSTEM SYSTEM 826 Sep 4 22:43 hosts + + Symbolic links