Guido van Rossum | 07a272d | 1995-04-10 11:40:52 +0000 | [diff] [blame] | 1 | import time |
Neal Norwitz | ce96f69 | 2006-03-17 06:49:51 +0000 | [diff] [blame] | 2 | import sys |
Guido van Rossum | 07a272d | 1995-04-10 11:40:52 +0000 | [diff] [blame] | 3 | import FSProxy |
| 4 | |
| 5 | def main(): |
Tim Peters | e6ddc8b | 2004-07-18 05:56:09 +0000 | [diff] [blame] | 6 | t1 = time.time() |
| 7 | #proxy = FSProxy.FSProxyClient(('voorn.cwi.nl', 4127)) |
| 8 | proxy = FSProxy.FSProxyLocal() |
| 9 | sumtree(proxy) |
| 10 | proxy._close() |
| 11 | t2 = time.time() |
Collin Winter | 6f2df4d | 2007-07-17 20:59:35 +0000 | [diff] [blame] | 12 | print(t2-t1, "seconds") |
Neal Norwitz | ce96f69 | 2006-03-17 06:49:51 +0000 | [diff] [blame] | 13 | sys.stdout.write("[Return to exit] ") |
| 14 | sys.stdout.flush() |
| 15 | sys.stdin.readline() |
Guido van Rossum | 07a272d | 1995-04-10 11:40:52 +0000 | [diff] [blame] | 16 | |
| 17 | def sumtree(proxy): |
Collin Winter | 6f2df4d | 2007-07-17 20:59:35 +0000 | [diff] [blame] | 18 | print("PWD =", proxy.pwd()) |
Tim Peters | e6ddc8b | 2004-07-18 05:56:09 +0000 | [diff] [blame] | 19 | files = proxy.listfiles() |
| 20 | proxy.infolist(files) |
| 21 | subdirs = proxy.listsubdirs() |
| 22 | for name in subdirs: |
| 23 | proxy.cd(name) |
| 24 | sumtree(proxy) |
| 25 | proxy.back() |
Guido van Rossum | 07a272d | 1995-04-10 11:40:52 +0000 | [diff] [blame] | 26 | |
| 27 | main() |