On Sun, May 12, 2013 at 1:33 AM, André Malo <ndpar...@gmail.com> wrote: > * Serhiy Storchaka wrote: > >> Another example is running a subprocess in Unix-like systems. >> >> fork() >> open/close file descriptors, set limits, etc >> exec*() > > For running a subprocess, only fork() is needed. For starting another > executable, only exec() is needed. For running the new executable in a > subprocess fork() and exec() are needed. I think, that's a bad example. > These APIs are actually well-designed.
That said, though, there's certainly plenty of room for one-call APIs like popen. For the simple case where you want to start a process with some other executable, wait for it to finish, and then work with its return value, it makes sense to hide the details of fork/exec/wait - especially since that simple API can be cross-platform, where fork() itself is quite hard to implement on Windows. ChrisA -- http://mail.python.org/mailman/listinfo/python-list