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?


Dave Korn wrote:

>   This relies on the mountpoints being set correctly, which might not work if
> your drive letter changes ...

Well if that is the case and / points to the wrong dir then I don't see
how you can be using Cygwin at all, so many things will be broken.  To
get the POSIX path of the rootdir of the drive correponding to the CWD,
then you can use something like:

whatever="$(mount -p | tail -n1 | cut -f1 -d' ')$(cmd.exe /c "cd" \
          | cut -b1 | tr 'A-Z' 'a-z')"

But I don't see how this is useful in the least, since by definition if
the mount table does not refelect reality then using POSIX paths for any
purpose is unreliable at best and a waste of time at worst, so finding
the POSIX path corresponding to the rootdir seems pointless.  If you
want to update the mount table you need the win32 path, not the POSIX
path, and if the mount table has already been updated then this is much
simpler.

Brian

--
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]