1995-04-10 08:40:52 -03:00
|
|
|
import time
|
2006-03-17 02:49:51 -04:00
|
|
|
import sys
|
1995-04-10 08:40:52 -03:00
|
|
|
import FSProxy
|
|
|
|
|
|
|
|
def main():
|
2004-07-18 02:56:09 -03:00
|
|
|
t1 = time.time()
|
|
|
|
#proxy = FSProxy.FSProxyClient(('voorn.cwi.nl', 4127))
|
|
|
|
proxy = FSProxy.FSProxyLocal()
|
|
|
|
sumtree(proxy)
|
|
|
|
proxy._close()
|
|
|
|
t2 = time.time()
|
2007-07-17 17:59:35 -03:00
|
|
|
print(t2-t1, "seconds")
|
2006-03-17 02:49:51 -04:00
|
|
|
sys.stdout.write("[Return to exit] ")
|
|
|
|
sys.stdout.flush()
|
|
|
|
sys.stdin.readline()
|
1995-04-10 08:40:52 -03:00
|
|
|
|
|
|
|
def sumtree(proxy):
|
2007-07-17 17:59:35 -03:00
|
|
|
print("PWD =", proxy.pwd())
|
2004-07-18 02:56:09 -03:00
|
|
|
files = proxy.listfiles()
|
|
|
|
proxy.infolist(files)
|
|
|
|
subdirs = proxy.listsubdirs()
|
|
|
|
for name in subdirs:
|
|
|
|
proxy.cd(name)
|
|
|
|
sumtree(proxy)
|
|
|
|
proxy.back()
|
1995-04-10 08:40:52 -03:00
|
|
|
|
|
|
|
main()
|