summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1992-12-15 21:43:04 (GMT)
committerGuido van Rossum <guido@python.org>1992-12-15 21:43:04 (GMT)
commitad5f862125fec14b11e76628430d2b4722195400 (patch)
tree9aa7543b26b553770fe5caffec4e721651a17869
parent20f9960427efed057106236ebafd44aa4fed05eb (diff)
downloadcpython-ad5f862125fec14b11e76628430d2b4722195400.zip
cpython-ad5f862125fec14b11e76628430d2b4722195400.tar.gz
cpython-ad5f862125fec14b11e76628430d2b4722195400.tar.bz2
Fix misunderstood readdir count (bytes, not dir entries)
and minor other changes.
-rw-r--r--Demo/rpc/nfsclient.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/Demo/rpc/nfsclient.py b/Demo/rpc/nfsclient.py
index 645a2a7..7a3a87d 100644
--- a/Demo/rpc/nfsclient.py
+++ b/Demo/rpc/nfsclient.py
@@ -169,7 +169,7 @@ class NFSClient(UDPClient):
# Shorthand to get the entire contents of a directory
def Listdir(self, dir):
list = []
- ra = (dir, 0, 16)
+ ra = (dir, 0, 2000)
while 1:
(status, rest) = self.Readdir(ra)
if status <> NFS_OK:
@@ -177,10 +177,9 @@ class NFSClient(UDPClient):
entries, eof = rest
last_cookie = None
for fileid, name, cookie in entries:
- print (fileid, name, cookie) # XXX
list.append(fileid, name)
last_cookie = cookie
- if eof or not last_cookie:
+ if eof or last_cookie == None:
break
ra = (ra[0], last_cookie, ra[2])
return list
@@ -208,6 +207,6 @@ def test():
print as
list = ncl.Listdir(fh)
for item in list: print item
- mcl.Unmnt(filesys)
+ mcl.Umnt(filesys)
test()