Re: call openoffice in linux from wine

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx> 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





[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux