Executing a system call

  • Thread starter Jagarlamudi Jagadeesh
  • Start date
J

Jagarlamudi Jagadeesh

Hi All,

There are so many ways to execute a system call like,
getstatusoutput()

os.system()

fork()
os.execvp()

using popen

Of all these, which is the best to use ( interms of speed and
resources) ?
 
J

Jorgen Grahn

Hi All,

There are so many ways to execute a system call like,
getstatusoutput()

os.system()

fork()
os.execvp()

using popen

And also os.spawnv*(), which unlike fork/exec work on some non-Unixes.
Of all these, which is the best to use ( interms of speed and
resources) ?

It depends ;-) Some of these go through the shell (which may give you features
you want, or features you *don't* want). I'd say the resources wasted on
executing a shell are almost always negligable; you should probably make a
decision based on functionality instead.

/Jorgen
 

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,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top