| 151 | sys.exit(1) |
| 152 | |
| 153 | def testall(list, recursive, toplevel): |
| 154 | import sys |
| 155 | import os |
| 156 | for filename in list: |
| 157 | if os.path.isdir(filename): |
| 158 | print(filename + '/:', end=' ') |
| 159 | if recursive or toplevel: |
| 160 | print('recursing down:') |
| 161 | import glob |
| 162 | names = glob.glob(os.path.join(glob.escape(filename), '*')) |
| 163 | testall(names, recursive, 0) |
| 164 | else: |
| 165 | print('*** directory (use -r) ***') |
| 166 | else: |
| 167 | print(filename + ':', end=' ') |
| 168 | sys.stdout.flush() |
| 169 | try: |
| 170 | print(what(filename)) |
| 171 | except OSError: |
| 172 | print('*** not found ***') |
| 173 | |
| 174 | if __name__ == '__main__': |
| 175 | test() |