Problem with execv

Michael Hudson mwh21 at cam.ac.uk
Fri Jun 30 20:16:25 EDT 2000


Jeremy Hylton <jeremy at beopen.com> writes:

> The correct calling convention is to supply a tuple or list as the
> second argument to execv.  Example:
> 
> >>> os.execv('/bin/ls', ('.',))
> [lists contents of current directory]

ITYM

>>> os.execv('/bin/ls',('ls','.'))

or some such.  There's also

>>> os.execlp('ls','ls','.')

and many other variants...

Cheers,
M.

-- 
7. It is easier to write an incorrect program than understand a
   correct one.
  -- Alan Perlis, http://www.cs.yale.edu/homes/perlis-alan/quotes.html



More information about the Python-list mailing list