summaryrefslogtreecommitdiffstats
path: root/Demo/pdist/sumtree.py
diff options
context:
space:
mode:
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()