4 # On stderr, near and total misses are reported.
5 # '-l<flags>' argument adds ls -l<flags> of each file found.
8 if sys
.path
[0] in (".", ""): del sys
.path
[0]
10 import sys
, os
, string
14 sys
.stderr
.write(str + '\n')
16 pathlist
= string
.splitfields(os
.environ
['PATH'], ':')
21 if sys
.argv
[1:] and sys
.argv
[1][:2] == '-l':
22 longlist
= sys
.argv
[1]
25 for prog
in sys
.argv
[1:]:
28 file = os
.path
.join(dir, prog
)
33 if not S_ISREG(st
[ST_MODE
]):
34 msg(file + ': not a disk file')
36 mode
= S_IMODE(st
[ST_MODE
])
48 msg(file + ': not executable')
50 sts
= os
.system('ls ' + longlist
+ ' ' + file)
51 if sts
: msg('"ls -l" exit status: ' + `sts`
)
53 msg(prog
+ ': not found')