Popen3-style os.execl?

C

Chris Green

Hey folks,

I'm whipping up a quick CGI to wrap a command line app and I was a bit
suprised to not find a execl-like Popen3 style object. I don't want
to bother with the shell interpreting metacharaters by constructing a
command line.

Basically, I want something that acts just like Popen3 but allows me
to specify cmd as a path + args. Does something like this exist in
the standard library? If not, it sounds like a good candidate...

Cheers,
Chris
 
D

Donn Cave

Chris Green <[email protected]> said:
Hey folks,

I'm whipping up a quick CGI to wrap a command line app and I was a bit
suprised to not find a execl-like Popen3 style object. I don't want
to bother with the shell interpreting metacharaters by constructing a
command line.

Basically, I want something that acts just like Popen3 but allows me
to specify cmd as a path + args. Does something like this exist in
the standard library? If not, it sounds like a good candidate...

Did you try it? I think of Popen3 as something that
acts just like you describe, but also accepts a command
line. Not the best API, maybe.

Donn Cave, (e-mail address removed)
 
M

Michael Hudson

Chris Green said:
Hey folks,

I'm whipping up a quick CGI to wrap a command line app and I was a bit
suprised to not find a execl-like Popen3 style object. I don't want
to bother with the shell interpreting metacharaters by constructing a
command line.

Basically, I want something that acts just like Popen3 but allows me
to specify cmd as a path + args. Does something like this exist in
the standard library? If not, it sounds like a good candidate...

Um. Can't you pass a list to the Popen3 constructor?

Cheers,
mwh
 
C

Chris Green

Michael Hudson said:
Um. Can't you pass a list to the Popen3 constructor?

Well, by golly ya can. Since cmd is only ever one argument in the
docs, I've never known that you could do this.
 
M

Michael Hudson

Chris Green said:
Well, by golly ya can. Since cmd is only ever one argument in the
docs, I've never known that you could do this.

Ah, uh, right: this isn't documented. I'm not sure why... as noted,
it doesn't work on Windows, but then if you were talking about execl,
you presumably aren't that concerned.

Cheers,
mwh
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top