0

I have problems passign windows path to an non-Cygwin application in Cygwin

app 'd:\path\file'

That application gives an error of /d:/path/file does not exist.

How stop Cygwin with modifying the input argument in this case?

It prepends / to the path.

It does not prepend, it just looks so by the misleading error message.

SysDragon
  • 9,692
  • 15
  • 60
  • 89
Aftershock
  • 5,205
  • 4
  • 51
  • 64

2 Answers2

1

You can protect the path by enclosing in quotes e.g. notepad "c:\a.txt". You also might need to protect the backslash (\) characters in the path by doubling them (notepad "c:\\a.txt").

Attila
  • 28,265
  • 3
  • 46
  • 55
  • What does notepad say for these two invocations from cygwin: `notepad c:\\a.txt` and `notepad "c:\\a.txt"`? Assuming there is no a.txt in the root directory of the C drive, it should pop up a dialog displaying the path as it (notepad) sees it. You could experiment with that a bit. – Attila Mar 21 '12 at 18:55
  • yes, this works. It looks like the problem is application specific – Aftershock Mar 21 '12 at 20:31
0

Which version are you using? I don't see that with my cygwin. You may have better luck with

app "$(cygpath -ma <cygwin-path<)"

My environment:

$ cygcheck -c bash cygwin
Cygwin Package Information
Package              Version        Status
bash                 4.1.10-4       OK
cygwin               1.7.9-1        OK
$ cat check.bat
@echo %1%
$ ./check.bat 'c:\cygwin\tmp\t'
c:\cygwin\tmp\t
Miserable Variable
  • 28,432
  • 15
  • 72
  • 133