[Top][All Lists]

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

Re: [Gnu-arch-users] Re: Extension language

From: Charles Duffy
Subject: Re: [Gnu-arch-users] Re: Extension language
Date: Sat, 18 Oct 2003 04:31:04 -0500

On Sat, 2003-10-18 at 04:18, address@hidden wrote:
> Please explain how you would pass something like 'export DEBUG=false' to the
> environment of the application you start using system. I'm assuming system 
> here
> since I have not heard any alternative.

Why use system()? Using system makes an unnecessary shell invocation.
Much better to go the fork/exec (or popen, or whatever) route.

Here's one trivial example:

        import os
        os.execve('/path/to/some/program', ['program', 'arg1', 'arg2'], 

or perhaps you could have just set the environment for yourself and let
it be inherited through the exec:

        os.environ['DEBUG'] = 'false'
        os.execl('/path/to/some/program', 'program', 'arg1')

or one of the many, many other ways of doing it.

Everything I mentioned here has a trivial alternative API in C, Perl,
and every other language worth a damn.

> If you say its certainly possible; it would be nice to actually say what that 
> way
> is.  Argument your case, don't just point in the air.

Okay, not pointing in the air now.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]