Question about convert between unix path and windows path

Questions about Wine on Linux
Locked
maz_1
Newbie
Newbie
Posts: 2
Joined: Thu May 01, 2014 10:36 pm

Question about convert between unix path and windows path

Post by maz_1 »

When pass parameters to program running under wine,wine will automatically convert unix style path into windows style
However,it fails to convert correctly when file path contains tilde(which means $HOME in bash)
For example

Code: Select all

~/.wine
will be converted to

Code: Select all

G:\home\username\~\.wine
instead of

Code: Select all

G:\home\username\.wine
Any solutions to that?
oiaohm
Level 8
Level 8
Posts: 1020
Joined: Fri Feb 29, 2008 2:54 am

Re: Question about convert between unix path and windows pat

Post by oiaohm »

When pass parameters to program running under wine,wine will automatically convert unix style path into windows style
I am sorry to have to burst your bubble the reality wine in fact does not do this. Build the following little program with mingw32 or equal windows compiler.

Code: Select all

#include <stdio.h>
#include <stdlib.h>

int main (int argc, char **argv) {
    int i;
for (i = 0; i < argc; i++) {
 printf("%s\n", argv[i]);
    }

    return EXIT_SUCCESS;
}
Yes this is a simple print what arguments application receives. You will find wine is not processing the arguments at all. There is a major mistake people make NT operating systems like XP 7 .... in fact support using either / or \ as path separator just always display \. There is no way for wine to tell a unix path from a nt path. Yes this G:/home/username/.wine is a valid windows path. This is not wine being magic its just obeying what NT demands.

Need to convert from unix style to wine style there is a official command todo that. winepath -w <unixpath> even so this does not process ~ to home. Bash and posix shells does ~ to home conversion. With the above program built for linux do "\~" under bash as a arguement. Now you should see the problem. winepath cannot do home solve on ~ without risking being incompatible to a real path pass. Yes it valid under Linux for a folder named "~" to exist. Maybe a feature request for winepath to add a control flag to convert ~ to path .
Locked