1 # os.py -- either mac or posix depending on what system we're on.
4 # - all functions from either posix or mac, e.g., os.unlink, os.stat, etc.
5 # - os.path is either module posixpath or macpath
6 # - os.name is either 'posix' or 'mac'
7 # - os.curdir is a string representing the current directory ('.' or ':')
8 # - os.pardir is a string representing the parent directory ('..' or '::')
9 # - os.sep is the (or a most common) pathname separator ('/' or ':')
11 # Programs that import and use 'os' stand a better chance of being
12 # portable between different platforms. Of course, they must then
13 # only use functions that are defined by all platforms (e.g., unlink
14 # and opendir), and leave all pathname manipulation to os.path
15 # (e.g., split and join).
17 # XXX This will need to distinguish between real posix and MS-DOS emulation
22 from posix
import _exit
42 def execl(file, *args
):
45 def execle(file, *args
):
47 execve(file, args
[:-1], env
)
49 def execlp(file, *args
):
52 def execvp(file, args
):
57 if environ
.has_key('PATH'):
59 PATH
= string
.splitfields(environ
['PATH'], ':')
61 PATH
= ['', '/bin', '/usr/bin']
62 exc
, arg
= (ENOENT
, 'No such file or directory')
64 fullname
= path
.join(dir, file)
67 except error
, (errno
, msg
):
69 exc
, arg
= error
, (errno
, msg
)