Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm running Windows XP and Cygwin. Is there a way to create some kind of symbolic link so that, if a non-Cygwin program is passed /cygdrive/c as a command line argument, it looks in c:\ for whatever file/directory it needs?

share|improve this question

2 Answers 2

up vote 3 down vote accepted

There is a way to create symbolic links on Windows, download the Junction tool from Microsoft and use it to create a symbolic link (On NTFS they are implemented as junction points). And then create a \cygdrive\c directory and create a junction point form it to c:\

md \cygdrive\c
junction \cygdrive\c \

Now this may or may not work, I don't have cygwin installed. It relies on:

  1. Programs interpreting the forward slashes in /cygdrive/c as backslashes (which some may do)
  2. Having your working directory set to the drive with the symlinks since paths starting with \ are relative to the current drive.
share|improve this answer
    
Obviously not a perfect solution for the reasons you mentioned, but definitely good enough for my needs. –  dsimcha Nov 5 '09 at 20:15
    
Junctions are not the same as symlinks (which only appeared in Vista). –  grawity Nov 5 '09 at 20:59
    
But they're good enough. I have this solution up and running. –  dsimcha Nov 7 '09 at 17:18

If you are calling cygwin-unaware programs from cygwin's bash and passing paths as arguments like

$ windowsProgram.exe "pathArg1" "pathArg2"

then maybe convert every pathArg into "$(cygpath -w pathArg)" i.e. say

$ windowsProgram.exe "$(cygpath -w pathArg1)" "$(cygpath -w pathArg2)"

. Ugly, but should work?

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.