Staging
v0.5.1
https://github.com/python/cpython
Revision 24e7a29292489c7fe2ba4e023b798d5626be04b6 authored by Fred Drake on 12 April 2001, 12:37:03 UTC, committed by Fred Drake on 12 April 2001, 12:37:03 UTC
1 parent ce260d5
Raw File
Tip revision: 24e7a29292489c7fe2ba4e023b798d5626be04b6 authored by Fred Drake on 12 April 2001, 12:37:03 UTC
Work around the conversion of ">>" and "<<" to guillemets. Reported by
Tip revision: 24e7a29
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