Arguments to exec* functions.

Neil Cerutti cerutti at together.net
Mon Nov 13 15:30:13 EST 2000


Michael Hudson posted:
>cerutti at together.net (Neil Cerutti) writes:
>
>> Am I required to pass the name and path of the executable as the
>> first item in the tuple or list of arguments to an exec*()
>> function? I know some programs depend on the name of the
>> executable for functional changes, e.g., gzip.
>
>On my system:
>
>$ ls --inode /bin/*zip
>  30165 /bin/gunzip    30165 /bin/gzip
>
>i.e. "gzip" and "gunzup" actually are the same file, so the
>executable needs some way to tell which is was invoked as -
>hence argv[0].

Yes, I understand that. But why can't the os module extrapolate
it for me, instead of forcing me to do it manually?

Fredrik Lundh says it follows the POSIX standard; that explains
the semantics of argv, but it doesn't explain why the os module
wraps it this way. Is it often useful to run a process and lie to
it about its own name?

-- 
Neil Cerutti <cerutti at together.net>



More information about the Python-list mailing list