blob: 92e7771cbfa0ded174a3f3736b66665ffb29bd3e [file] [log] [blame]
Guido van Rossum07a272d1995-04-10 11:40:52 +00001import time
Neal Norwitzce96f692006-03-17 06:49:51 +00002import sys
Guido van Rossum07a272d1995-04-10 11:40:52 +00003import FSProxy
4
5def main():
Tim Peterse6ddc8b2004-07-18 05:56:09 +00006 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 Winter6f2df4d2007-07-17 20:59:35 +000012 print(t2-t1, "seconds")
Neal Norwitzce96f692006-03-17 06:49:51 +000013 sys.stdout.write("[Return to exit] ")
14 sys.stdout.flush()
15 sys.stdin.readline()
Guido van Rossum07a272d1995-04-10 11:40:52 +000016
17def sumtree(proxy):
Collin Winter6f2df4d2007-07-17 20:59:35 +000018 print("PWD =", proxy.pwd())
Tim Peterse6ddc8b2004-07-18 05:56:09 +000019 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 Rossum07a272d1995-04-10 11:40:52 +000026
27main()