os.execv

Létezõ letezo at fw.hu
Tue Mar 4 20:33:29 EST 2003


This should work:

import os
os.execv('/usr/bin/find',['find','/','-name','test'])

It looks like, that the argumens must be written into separate list/tuple
item in args.

Best wishes: Viktor

======================================

----- Original Message -----
From: "Ulrich Petri" <ulope at gmx.de>
Newsgroups: comp.lang.python
To: <python-list at python.org>
Sent: Wednesday, March 05, 2003 2:17 AM
Subject: os.execv


> Hi,
>
> i feel somewhat stupid for not beeing able to figure this one out... :
>
> I try to use the os.exec[vl] function.
>
> ----
> >>> import os
> >>> os.execv("/usr/bin/find", ("find", "/ -name test"))
> find: / -name test: No such file or directory
>
> >>> import os
> >>> os.execl("/usr/bin/find", "find", "/ -name test")
> find: / -name test: No such file or directory
>
> ----
> isn't this supposed to work? so what am i doing wrong?
>
> Thanks
>
> Ciao Ulrich
>
> PS: I'm using Python 2.2.1 (src) on linux (SuSE)
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
>








More information about the Python-list mailing list