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: 1.7] Can you have multipe cygdrive path prefixes active at once

aputerguy wrote:
> Jeremy Bopp writes:
>> Well, it's a bit of a hack, but you could try something like the
>> following:
>> $ dirname $(cygpath -u C:/)
>> This assumes that there is always a C: drive and converts the path to
>> the root of that drive into a POSIX path which will include the cygdrive
>> prefix.  Then dirname is used to effectively chop off the drive letter
>> leaving you with the cygdrive prefix.
> This doesn't seem to work in the case where you have mounted the C: drive.
> For example I mount C: on /c
> And the above returns:
> $ dirname $(cygpath -u c:/)
> /
> which doesn't tell me what the cygdrive prefix is -- only where 'c' is
> mounted.
> Of course, as pointed out in a later reply, one can use an unused disk drive
> letter like 'x' but that is hardly robust since who knows what drive letters
> will be unused and/or unmounted.

Assuming you do find a reliable way to discover the cygdrive prefix, how
do you plan to handle mapped drives for remote shares?  I ask because
you mentioned that you might want to be able to run something like find
on the cygdrive prefix itself, and of course scanning a remote share
like that may not be desirable.  Also, how do you handle the mounted C:
case as well?  Even if you mount it to /c as you have done, I think
/cygdrive/c will also have it.


Problem reports:
Unsubscribe info:

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