summaryrefslogtreecommitdiff
path: root/Demo/pdist/sumtree.py
blob: 92c1fd05527ce6127700e100adb9ae019f2d2ae6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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()