Staging
v0.8.1
https://github.com/python/cpython
Raw File
Tip revision: 2a9b0a93091b9ef7350a94bb3d3f1c43725b7a8c authored by Georg Brandl on 05 March 2011, 13:54:19 UTC
Close 2.0 branch.
Tip revision: 2a9b0a9
sumtree.py
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()
back to top