Derek Basch wrote:
If the syntax of spawnl is:

spawnl(mode, path, ...)

Why does everyone write it like:

os.spawnlp(os.P_WAIT, 'cp', 'cp', 'index.html', '/dev/null')

or:

os.spawnl(os.P_WAIT, "/var/www/db/smm/smm_train", "smm_train",
"SMMTrainInput.xml")

How is the first 'cp' a path to a file? why does the desired executable have to
be named again as the first parameter?

Marginally educated guessing:

1. "cp" is a shell command, so no path is required or possible.

2. The repetition of the executable name is so that argv[0] can
   have the expected contents: the name of the executable.

-Peter
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to