Im trying to convert the file paths to/from Linux and Windows on Windows Machine.
unix path to windows works fine.
$ cygpath -w /cygdrive/c/CYGWIN/CYGBuild/build.mak
C:\CYGWIN\CYGBuild\build.mak
But windows path to Linux gives wrong output. i.e Missing '/' and also cygdrive
$ cygpath -u c:\cygwin\cygbuild\build.mak
c:cygwincygbuildbuild.mak
Anyone faced this issue?? Share your experience.
Thanks
I got answer for this question.
cygpath -u 'c:\cygwin\cygbuild\build.mak'
i.e path should be given in single quotation.
Actually as far as I know; you need forward slashes in paths used in cygwin. Single quotations help in cases where there are spaces (and my guess in this case; using backslashes instead of forward slashes) in the path. Otherwise backslashes are like escape characters, while spaces (although not in your case) require escape characters themselves. So quoting the path tends to eliminate such hassles.
Here are links that help me understand this:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With