Deconflict Unix Forward / and Windows Back Slash \ Directory

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
stvs
Level 1
Level 1
Posts: 8
Joined: Fri Dec 03, 2010 11:13 am

Deconflict Unix Forward / and Windows Back Slash \ Directory

Post by stvs »

Is it possible to tell WINE to deconflict Unix-style forward slashes and Windows-style backslashes in directory names? I have a problem where a .EXE file goes looking for directory and file names that look like

/home/base_dir\sub_dir\file.dat

[NOTE mixed forward slash and backslash / vs \ in full directory name]

The base directory "/home/base_dir" is passed to the .EXE (which it finds successfully), but then the .EXE appends its own subdirectory and files names with the incorrect backslash delimiter. Needless to say, the .EXE cannot find the files it needs. Passing in the base directory as "\home\base_dir" doesn't work at all because this syntax is incorrect on BSD.

Is there some flag or trick to tell WINE to interpret the correct directory syntax on BSD? I'm stuck with the executable I have.
Thunderbird
Level 5
Level 5
Posts: 336
Joined: Mon Nov 24, 2008 8:10 am

Post by Thunderbird »

What are you really trying to achieve? It sounds like you are creating some script to start an application or some wrapper. If that's the case winepath might be what you want.
User avatar
Bob Wya
Level 12
Level 12
Posts: 3068
Joined: Sat Oct 16, 2010 7:40 pm

Re: Deconflict Unix Forward / and Windows Back Slash \ Direc

Post by Bob Wya »

stvs wrote:Passing in the base directory as "\home\base_dir" doesn't work at all because this syntax is incorrect on BSD.

Is there some flag or trick to tell WINE to interpret the correct directory syntax on BSD? I'm stuck with the executable I have.
Uhhmmm. If you mean what I think you mean then you would escape the Windows directory delimiting forward slashes:

Code: Select all

"\\home\\base_dir"
Otherwise your BSD shell will try and put an escaped "h" character and an escaped "b" character in that Wine path.

Bob
stvs
Level 1
Level 1
Posts: 8
Joined: Fri Dec 03, 2010 11:13 am

Re: Deconflict Unix Forward / and Windows Back Slash \ Direc

Post by stvs »

I must run a given Windows executable that comes with a fixed data directory whose base is,

Code: Select all

/home/base_dir
These are both fixed -- I did not write or compile them, but must simply run the executable.

If I specify "/home/base_dir" (as a string in the config file config.txt) for this base dir, then the WINE command

Code: Select all

wine ./reader.exe ./config.txt
successfully finds the directory "/home/base_dir", but FAILs when reader.exe attempts to access those contents using the string

Code: Select all

/home/base_dir\sub_dir\file.dat
If I specify the string "\home\base_dir" or "\\home\base_dir", or any other non-BSD compliant directory specification, the reader.exe command FAILs and is unable to find the base directory.

The question is whether there is some flag or trick to tell wine, or even BSD, that the full file string "\\home\base_dir\sub_dir\file.dat" really means "/home/base_dir/sub_dir/file.dat" in BSD-land.
oiaohm
Level 8
Level 8
Posts: 1020
Joined: Fri Feb 29, 2008 2:54 am

Post by oiaohm »

stvs thank you for playing with land mines.

Really support for wine taking Linux native paths for EXE's would be wise to delete and force the use of Windows Paths.

winepath provides you with a means to converting to windows paths.

Wine cannot process the command line after the executable to convert from Linux path format to Windows for the application. Reason some applications require flags done /? and the like.

Basically the failure you are seeing is perfectly normal and its miss using wine to have the failure.

Code: Select all

/home/base_dir\sub_dir\file.dat
This is caused by something so simple.

reader.exe is passed to wine as /home/base_dir/reader.exe

Path is extracted from that. /home/base_dir then added to where it wants it file.

Correct solution is wine Z:\\home\\base_dir\\reader.exe

Yes you missed drive letter.
Locked