diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2015-12-06 19:25:48 +0300 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2015-12-06 19:25:48 +0300 |
commit | 5aa8817e3a56da2b4177329e2d523f54eae7e142 (patch) | |
tree | 9cb862606b1d946f85cdc441d9131929ffcd4acf /winsup/doc | |
parent | 3ff65caea58441cecf65a53f01a7e566be01c51c (diff) |
Allow cygwin_conv_path(3) and cygpath(1) to emit /proc/cygdrive prefixed path
* include/sys/cygwin.h (CCP_PROC_CYGDRIVE): New flag.
* mount.cc (mount_info::cygdrive_posix_path): Take flag values rather
than just a trailing_slash_p bool. Emit /proc/cygdrive path if
CCP_PROC_CYGDRIVE flag is given.
(mount_info::conv_to_posix_path): Take flag values rather than just
a keep_rel_p bool. Rename _p variables. Print flag value as hex in
debug_printf. Call cygdrive_posix_path with flag values.
* mount.h (mount_info::cygdrive_posix_path): Accommodate above change
in declaration.
(mount_info::conv_to_posix_path): Ditto.
* fhandler_process.cc (format_process_exename): Accommodate change to
mount_info::conv_to_posix_path.
* path.cc (cygwin_conv_path): Ditto.
* cygpath.cc (absolute_flag): Initialize to CCP_RELATIVE to simplify
expressions.
(cygdrive_flag): New global flag.
(long_options): Add --proc-cygdrive option.
(options): Add -U option.
(usage): Add description for -U option.
(do_sysfolders): Or cygdrive_flag to cygwin_conv_path call.
(do_pathconv): Simply or absolute_flag to conv_func. Or
cygdrive_flag to conv_func.
(do_options): Initalize absolute_flag to CCP_RELATIVE. Initialize new
cygdrive_flag. Set absolute_flag to CCP_ABSOLUTE on -a. Set
cygdrive_flag to CCP_PROC_CYGDRIVE on -U.
* new-features.xml (ov-new2.4): Document cygpath -U option.
* utils.xml (cygpath): Ditto.
* path.xml (func-cygwin-path): Add CCP_PROC_CYGDRIVE description.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'winsup/doc')
-rw-r--r-- | winsup/doc/ChangeLog | 6 | ||||
-rw-r--r-- | winsup/doc/new-features.xml | 5 | ||||
-rw-r--r-- | winsup/doc/path.xml | 6 | ||||
-rw-r--r-- | winsup/doc/utils.xml | 12 |
4 files changed, 27 insertions, 2 deletions
diff --git a/winsup/doc/ChangeLog b/winsup/doc/ChangeLog index e5477cee2..f9ae2b54e 100644 --- a/winsup/doc/ChangeLog +++ b/winsup/doc/ChangeLog @@ -1,3 +1,9 @@ +2015-12-06 Corinna Vinschen <corinna@vinschen.de> + + * new-features.xml (ov-new2.4): Document cygpath -U option. + * utils.xml (cygpath): Ditto. + * path.xml (func-cygwin-path): Add CCP_PROC_CYGDRIVE description. + 2015-11-25 David Macek <david.macek.0@gmail.com> * faq-using.xml: Add MacType to the BLODA. Fix formatting. diff --git a/winsup/doc/new-features.xml b/winsup/doc/new-features.xml index 21bc6911f..98a9e6c14 100644 --- a/winsup/doc/new-features.xml +++ b/winsup/doc/new-features.xml @@ -32,6 +32,11 @@ created by Cygwin processes. </para></listitem> <listitem><para> +cygpath has a new -U option, which creates cygdrive paths using the +unambiguous /proc/cygdrive prefix. +</para></listitem> + +<listitem><para> New API: rpmatch. </para></listitem> diff --git a/winsup/doc/path.xml b/winsup/doc/path.xml index bea67980a..81d4c3f35 100644 --- a/winsup/doc/path.xml +++ b/winsup/doc/path.xml @@ -54,8 +54,10 @@ relative paths in relative notation. Creating absolute paths is the default.</para> <programlisting> - CCP_ABSOLUTE = 0, /* Request absolute path (default). */ - CCP_RELATIVE = 0x100 /* Request to keep path relative. */ + CCP_ABSOLUTE = 0, /* Request absolute path (default). */ + CCP_RELATIVE = 0x100 /* Request to keep path relative. */ + CCP_PROC_CYGDRIVE = 0x200 /* Request to return /proc/cygdrive path + (only with CCP_*_TO_POSIX). */ </programlisting> <para><parameter>size</parameter> is the size of the buffer pointed to diff --git a/winsup/doc/utils.xml b/winsup/doc/utils.xml index f48bfaec0..d0f871efe 100644 --- a/winsup/doc/utils.xml +++ b/winsup/doc/utils.xml @@ -315,6 +315,8 @@ Path conversion options: -a, --absolute output absolute path -l, --long-name print Windows long form of NAMEs (with -w, -m only) -p, --path NAME is a PATH list (i.e., '/bin:/usr/bin') + -U, --proc-cygdrive Emit /proc/cygdrive path instead of cygdrive prefix + when converting Windows path to UNIX path. -s, --short-name print DOS (short) form of NAMEs (with -w, -m only) -C, --codepage CP print DOS, Windows, or mixed pathname in Windows codepage CP. CP can be a numeric codepage identifier, @@ -380,6 +382,16 @@ Other options: graphical tools like Windows Explorer might expect pathnames in the current ANSI codepage.</para> + <para>The <literal>-U</literal> option allows to use cygpath to create + unambiguous Unix paths pointing outside the Cygwin tree andf thus having + no explicit POSIX path. Those paths usually use the cygdrive prefix. + However, the cygdrive prefix can be changed by the user, so symbolic links + created using the cygdrive prefix are not foolproof. With + <literal>-U</literal> cygpath will generate such paths prepended by the + virtual <pathname>/proc/cygdrive</pathname> symbolic link, which will + never change, so the created path is safe against changing the cygdrive + prefix.</para> + <para>The <literal>-C</literal> option takes a single parameter:</para> <itemizedlist spacing="compact"> <listitem> |