[Wine] call openoffice in linux from wine

Martin Gregorie martin at gregorie.org
Mon Nov 30 13:31:21 CST 2009


On Mon, 2009-11-30 at 19:52 +0200, Gert van den Berg wrote:
> On Mon, Nov 30, 2009 at 17:10, fachamix <wineforum-user at winehq.org> wrote:
> > Code:
> > #include <stdio.h>
> > #include <stdlib.h>
> >
> > int main()
> > {
> >    printf("probando ejecutable");
> >    printf("llamando a ABIWORD desde wine ...");
> >    system("/bin/sh -c \"/script.run file.txt\"");
> >    return 0;
> > }
> >
> > works perfectly
> >
> any reason why its necessary to involve a shell?
> 
I think that makes sense. WINE doesn't seem able to run a script
directly - it certainly won't recognise the #!/bin/bash idiom, so it
follows that you need the start the shell explicitly by using the
"/bin/sh -c" construction. It doesn't appear to parse the rest of the
line correctly, so passing "script arguments..." ads a single string
will hand the lot to the explicit shell, which will parse it. Once the
Linux shell is running and has started executing the script, all the
usual idioms (hash-bang, backtick, etc) will also work. However, the
environment might be quite limited: best to run the 'env' command just
to see how the environment has been set up.
  
> (Standard system does not seem to support it, but one of exec &
> friends might...)
> 
Are the exec() ... family of functions available to the OP's compiler?
They may be if the OP is using mingw or djgpp but IIRC were not
available in the Borland compilers and are possibly not supported by MS
compilers.

Martin






More information about the wine-users mailing list