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: chere + mintty doesn't work with mapped drives


On 01/12/2013 21:09, Corinna Vinschen wrote:
On Dec  1 15:48, Charles Butterfield wrote:
-----Original Message-----
From: David Kilroy [mailto:kilroyd@googlemail.com]
Can you run the following commands from mintty running bash vs cmd
running bash:

cygpath -u "y:\apps"
test -d /cygdrive/y/apps
echo $?

Result of the first command should be /cygdrive/y/apps 2nd command
shouldn't output anything Result of 3rd command should be 0 (true)

Dave.
Results from MINTTY+BASH:
----------------------------------
$ cygpath -u "y:\apps"
/cygdrive/y/apps

$ test -d /cygdrive/y/apps

$ echo $?
1

Results from CMD+BASH
------------------------------
$ cygpath -u "y:\apps"
/cygdrive/y/apps

$ test -d /cygdrive/y/apps

$ echo $?
0
Are you starting mintty with "run as administrator" by any chance?
Corrina's right - check that the same user is being used in both cases. I don't think this would explain why it's not working from the context menus though. Finding out why bash under mintty doesn't think /cygdrive/y/apps is a directory is the key.

Workaround: if you change everything in the if [ ! -z "$2" ] test in xhere to the snippet below, chere will attempt to change to the directory (but may fail)


Regards,

Dave.

if [ ! -z "$2" ]; then
 CHERE_DIR=`$CYGPATH "$2"`
 NETWORK_PATH=/$CHERE_DIR
 if [ -d "$CHERE_DIR" ]; then
  cd "$CHERE_DIR"

 # If the full path doesn't exist, this is prob a network path
 elif [ -d "$NETWORK_PATH" ]; then
  cd "$NETWORK_PATH"

 # Not a directory? Take a guess...
 else
  cd "$CHERE_DIR"

 fi
fi


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


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