Re: system_exec() on Linux

new topic     » goto parent     » topic index » view thread      » older message » newer message

Julio C. Galaret Viera wrote:
> 
> Robert Craig wrote:
> > 
> > Julio C. Galaret Viera wrote:
> > > According docs: "If it is not possible to run the program, system_exec()
> > > will
> > > return -1."
> > > 
> > > While that happens on Windows, on Linux does not return -1 when trying to
> > > run
> > > a program that does not exist.
> > > 
> > > Euphoria v. 2.5/3.l.1
> > 
> > I tried the system_exec() example on Linux.
> > It didn't return a -1 error code, but did
> > return a non-zero code (32512) which indicates an error. 
> > Is that what you got?
> > Maybe I just need to change the documentation.
> 
> Yes, I got that non-zero code but if successful also returns a non-zero code.
> Can I rely on 32512 as being always returned when failing to run?

system_exec() is just returning to you what was returned to it,
I think by the Linux shell. I don't know if you can rely on 
that particular number being returned across different 
versions of Linux. It might be safer if you were to use 
some other method to check if the program actually exists
and ran successfully.

Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu