| 247 | sys.exit(1) |
| 248 | |
| 249 | def testall(list, recursive, toplevel): |
| 250 | import sys |
| 251 | import os |
| 252 | for filename in list: |
| 253 | if os.path.isdir(filename): |
| 254 | print(filename + '/:', end=' ') |
| 255 | if recursive or toplevel: |
| 256 | print('recursing down:') |
| 257 | import glob |
| 258 | names = glob.glob(os.path.join(glob.escape(filename), '*')) |
| 259 | testall(names, recursive, 0) |
| 260 | else: |
| 261 | print('*** directory (use -r) ***') |
| 262 | else: |
| 263 | print(filename + ':', end=' ') |
| 264 | sys.stdout.flush() |
| 265 | try: |
| 266 | print(what(filename)) |
| 267 | except OSError: |
| 268 | print('*** not found ***') |
| 269 | |
| 270 | if __name__ == '__main__': |
| 271 | test() |