summaryrefslogtreecommitdiffstats
path: root/Demo/pdist/sumtree.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1995-04-10 11:40:52 (GMT)
committerGuido van Rossum <guido@python.org>1995-04-10 11:40:52 (GMT)
commit07a272d9dec67f8eb4f2bf1396a2f13671fdaba2 (patch)
tree5222965ba7973a2dd6848ea4d4a4cf5594e406db /Demo/pdist/sumtree.py
parent21bc15b73da1e3e5ab60ff9b93a95bfd390fea3f (diff)
downloadcpython-07a272d9dec67f8eb4f2bf1396a2f13671fdaba2.zip
cpython-07a272d9dec67f8eb4f2bf1396a2f13671fdaba2.tar.gz
cpython-07a272d9dec67f8eb4f2bf1396a2f13671fdaba2.tar.bz2
commit -- why not
Diffstat (limited to 'Demo/pdist/sumtree.py')
-rwxr-xr-xDemo/pdist/sumtree.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/Demo/pdist/sumtree.py b/Demo/pdist/sumtree.py
new file mode 100755
index 0000000..92c1fd0
--- /dev/null
+++ b/Demo/pdist/sumtree.py
@@ -0,0 +1,24 @@
+import time
+import FSProxy
+
+def main():
+ t1 = time.time()
+ #proxy = FSProxy.FSProxyClient(('voorn.cwi.nl', 4127))
+ proxy = FSProxy.FSProxyLocal()
+ sumtree(proxy)
+ proxy._close()
+ t2 = time.time()
+ print t2-t1, "seconds"
+ raw_input("[Return to exit] ")
+
+def sumtree(proxy):
+ print "PWD =", proxy.pwd()
+ files = proxy.listfiles()
+ proxy.infolist(files)
+ subdirs = proxy.listsubdirs()
+ for name in subdirs:
+ proxy.cd(name)
+ sumtree(proxy)
+ proxy.back()
+
+main()