Problem
Imagine you are writing a Python script which runs on cygwin and calls an external C# executable which requires as input a path. Assume you cannot change the C# executable in any way. As you send the path you want to the executable, it rejects all cygwin paths.
So if you pass the path /cygdrive/c/location/of/file.html
as a POSIX path, it will fail as the executable requires a Windows path like C:\location\of\file.html
Example:
Message location = os.path.dirname(os.path.realpath(__file__))
os.system('./cSharpScript.exe ' + message_location)
Will result in:
File for the content (/cygdrive/c/location/of/file.html) not found.
Things I've tried so far:
PATH = /cygdrive/c/location/of/file.html
1) path = PATH.replace('/','\\')
Result: File for the content (cygdriveclocationoffile.html) not found.
2) path = os.path.abspath(PATH)
Result: File for the content (/cygdrive/c/location/of/file.html) not found.
os.path.realpath
has the same results
I'm probably going in a completely wrong direction with my solutions so far... How would you handle it?