Discussion:
WineFAQ: 7.5. I want to associate a native program with a file type in Wine
(too old to reply)
KJensen
2011-02-25 18:42:08 UTC
Permalink
Hi,
I have submitted a change to the WineFAQ but it seems like you don't
like it -
as it keeps getting reverted... I'll try to explain the change here
(as a last
attempt)


In section 7.5. "I want to associate a native program with a file type
in Wine"
If the argument to the program contains spaces it will not work - so I
have
added sed to change " " (spaces) to "\ " like:

#!/bin/sh
$1 "`wine winepath -u "$2"`" | sed 's/ /\\ /'


I.e. you try to open a .doc file named "my document.doc" then without
sed,
openoffice will not be able to open the file. With sed added it will.
I'm sure that I'm not the only one with this problem.


Another minor thing: I believe most people will find it easier to
understand if
you use ~ as the reference to home instead of telling them to: "make
sure that
$HOME/bin directory is in your $PATH."

But that's just my two cents
Sincerely,
Kim Jensen

PS: I'm just trying to help - but that is a difficult task I see, and
that's shame.

I was not allowed to do so using the wiki..
It is not a "real" bug, so my bug-report was rejected
Well perhaps some mailing list will accept my request otherwise I give
up.
KJensen
2011-02-25 22:26:53 UTC
Permalink
Post by KJensen
Hi,
I have submitted a change to the WineFAQ but it seems like you don't
like it -
as it keeps getting reverted... I'll try to explain the change here
(as a last
attempt)
In section 7.5. "I want to associate a native program with a file type
in Wine"
If the argument to the program contains spaces it will not work - so I
have
#!/bin/sh
$1 "`wine winepath -u "$2"`" | sed 's/ /\\ /'
I.e. you try to open a .doc file named "my document.doc" then without
sed,
openoffice will not be able to open the file. With sed added it will.
I'm sure that I'm not the only one with this problem.
Another minor thing: I believe most people will find it easier to
understand if
you use ~ as the reference to home instead of telling them to: "make
sure that
$HOME/bin directory is in your $PATH."
But that's just my two cents
Sincerely,
Kim Jensen
PS: I'm just trying to help - but that is a difficult task I see, and
that's shame.
I was not allowed to do so using the wiki..
It is not a "real" bug, so my bug-report was rejected
Well perhaps some mailing list will accept my request otherwise I give
up.
I apologize that I have not been thorough enough in my test.
Regarding ~ it is obviously my fault - I was too quick on the trigger
so to
speak.

The second error - regarding pipe and sed - is still weird.
It is true that sed and pipe do nothing, but if I unplug it, then I
can not
open files with spaces. This is probably a configuration error /
misunderstanding by me. At least I think so because I have found out
that there
is a difference whether the command ends with a space or not: >$1
"`wine
winepath -u "$2"`"

However my open command looks different from that described in the FAQ
(but I
could not get that to work). Therefore my looks like this:
/bin/sh /home/kjensen/bin/run_linx_program ooffice "% 1"

I'm not sure why, but it works for me now but it is not due to "sed".

Sincerely,
Kim Jensen
Dan Kegel
2011-02-28 16:07:27 UTC
Permalink
I couldn't reproduce the problem here. Using the stock wine-1.3 from
the ubuntu ppa, I am able to right-click on "foo bar.log", choose
open with notepad, and the file opens fine...

Loading...