This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Fork and read my child's output


Hello,

I want a Guile script to execute an external program, and collect its
output, but not to use the shell at all for security and efficiency
purposes.

The standard idiom for doing this in Perl is with a special form of open()
which forks and then connects a filehandle with the child process stdout,
instead of with a regular file or pipe. Then it is possible to use exec()
and bypass the shell altogether.

So I want to do something similar in Guile. fork(), then in the child
process, sanitize environment and exec(). In the parent process, read the
child process stdout stream and process it. Just like open-input-pipe, but
safe from shell escapes.

Any help would be appreciated.

Humbly,

Andrew

----------------------------------------------------------------------
Andrew Ho               http://www.tellme.com/       andrew@tellme.com
Engineer                   info@tellme.com          Voice 650-930-9062
Tellme Networks, Inc.                                 Fax 650-930-9101
----------------------------------------------------------------------


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]