diff options
author | Guido van Rossum <guido@python.org> | 1992-03-30 11:13:59 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1992-03-30 11:13:59 (GMT) |
commit | e7b88e7402b3683afeec3ed602dd53288772991c (patch) | |
tree | 3f31c12fc6504ec423ba944312b3c7b364552ce8 /Tools/scripts/which.py | |
parent | b2ac8092a8f32de529675e14f3ba5c1f6ef06737 (diff) | |
download | cpython-e7b88e7402b3683afeec3ed602dd53288772991c.zip cpython-e7b88e7402b3683afeec3ed602dd53288772991c.tar.gz cpython-e7b88e7402b3683afeec3ed602dd53288772991c.tar.bz2 |
change posix to os
Diffstat (limited to 'Tools/scripts/which.py')
-rwxr-xr-x | Tools/scripts/which.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Tools/scripts/which.py b/Tools/scripts/which.py index 94c7556..d3186f4 100755 --- a/Tools/scripts/which.py +++ b/Tools/scripts/which.py @@ -4,13 +4,13 @@ # On stderr, near and total misses are reported. # '-l<flags>' argument adds ls -l<flags> of each file found. -import sys, posix, string, path +import sys, os, string from stat import * def msg(str): sys.stderr.write(str + '\n') -pathlist = string.splitfields(posix.environ['PATH'], ':') +pathlist = string.splitfields(os.environ['PATH'], ':') sts = 0 longlist = '' @@ -22,10 +22,10 @@ if sys.argv[1:] and sys.argv[1][:2] == '-l': for prog in sys.argv[1:]: ident = () for dir in pathlist: - file = path.join(dir, prog) + file = os.path.join(dir, prog) try: - st = posix.stat(file) - except posix.error: + st = os.stat(file) + except os.error: continue if not S_ISREG(st[ST_MODE]): msg(file + ': not a disk file') @@ -44,7 +44,7 @@ for prog in sys.argv[1:]: else: msg(file + ': not executable') if longlist: - sts = posix.system('ls ' + longlist + ' ' + file) + sts = os.system('ls ' + longlist + ' ' + file) if sts: msg('"ls -l" exit status: ' + `sts`) if not ident: msg(prog + ': not found') |