This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: How to uniformly point to the root of a drive?


Christopher Faylor wrote on Monday, May 21, 2007 12:16 AM:
> On Sun, May 20, 2007 at 09:12:47PM -0700, Karl M wrote:
>> Hi Christopher...
>> 
>>> From: Christopher Faylor Subject: Re: How to uniformly point to the
>>> root of a drive? Date: Sun, 20 May 2007 21:21:59 -0400
>>> 
>>> On Sun, May 20, 2007 at 05:39:21PM -0700, Karl M wrote:
>>>> Hi All...
>>>> 
>>>>> From: Christopher Faylor Subject: Re: How to uniformly point to
>>>>> the root of a drive? Date: Sun, 20 May 2007 13:36:16 -0400
>>>>> 
>>>>> On Sun, May 20, 2007 at 01:27:05PM -0400, Christopher Faylor
>>>>> wrote: 
>>>>>> So it sounds like Brian's method would work then wouldn't it?
>>>>> 
>>>>> Does this give you what you want, too?
>>>>> 
>>>>> driveroot=$(cygpath $(cygpath -wm /)/..)
>>>>> 
>>>> What is the difference between "cygpath -m ..." and "cygpath -wm
>>>> ..." 
>>> 
>>> Come on!  Read the fine manual.
>>> 
>> It is indeed a fine manual. I did look and -w and -m look to be
>> mutually exclusive in their use, but I did find scripts that use -wm,
>> thus my question.
> 
> So, translation: cgf made a typo.  The 'w' is not needed.
> 
> cgf

FYI, -wm and -mw do not give the same output.  I wouldn't know if this
would be considered a bug, as someone else pointed out that -m and -w
should be mutually exclusive, so neither should work.

===
/c> cygpath -wm /
c:/cygwin
/c> cygpath -mw /
Usage: cygpath (-d|-m|-u|-w|-t TYPE) [-f FILE] [OPTION]... NAME...
       cygpath [-c HANDLE]
       cygpath [-ADHPSW]
Convert Unix and Windows format paths, or output system path information

Output type options:
  -d, --dos             print DOS (short) form of NAMEs (C:\PROGRA~1\)
  -m, --mixed           like --windows, but with regular slashes
(C:/WINNT)
  -M, --mode            report on mode of file (binmode or textmode)
  -u, --unix            (default) print Unix form of NAMEs
(/cygdrive/c/winnt)
  -w, --windows         print Windows form of NAMEs (C:\WINNT)
  -t, --type TYPE       print TYPE form: 'dos', 'mixed', 'unix', or
'windows'
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')
  -s, --short-name      print DOS (short) form of NAMEs (with -w, -m
only)
System information:
  -A, --allusers        use `All Users' instead of current user for -D,
-P
  -D, --desktop         output `Desktop' directory and exit
  -H, --homeroot        output `Profiles' directory (home root) and exit
  -P, --smprograms      output Start Menu `Programs' directory and exit
  -S, --sysdir          output system directory and exit
  -W, --windir          output `Windows' directory and exit
Try `cygpath --help' for more information.
1.0 /c>

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]