mirror of
https://github.com/python/cpython.git
synced 2025-07-24 19:54:21 +00:00
Fix misunderstood readdir count (bytes, not dir entries)
and minor other changes.
This commit is contained in:
parent
20f9960427
commit
ad5f862125
1 changed files with 3 additions and 4 deletions
|
@ -169,7 +169,7 @@ class NFSClient(UDPClient):
|
||||||
# Shorthand to get the entire contents of a directory
|
# Shorthand to get the entire contents of a directory
|
||||||
def Listdir(self, dir):
|
def Listdir(self, dir):
|
||||||
list = []
|
list = []
|
||||||
ra = (dir, 0, 16)
|
ra = (dir, 0, 2000)
|
||||||
while 1:
|
while 1:
|
||||||
(status, rest) = self.Readdir(ra)
|
(status, rest) = self.Readdir(ra)
|
||||||
if status <> NFS_OK:
|
if status <> NFS_OK:
|
||||||
|
@ -177,10 +177,9 @@ class NFSClient(UDPClient):
|
||||||
entries, eof = rest
|
entries, eof = rest
|
||||||
last_cookie = None
|
last_cookie = None
|
||||||
for fileid, name, cookie in entries:
|
for fileid, name, cookie in entries:
|
||||||
print (fileid, name, cookie) # XXX
|
|
||||||
list.append(fileid, name)
|
list.append(fileid, name)
|
||||||
last_cookie = cookie
|
last_cookie = cookie
|
||||||
if eof or not last_cookie:
|
if eof or last_cookie == None:
|
||||||
break
|
break
|
||||||
ra = (ra[0], last_cookie, ra[2])
|
ra = (ra[0], last_cookie, ra[2])
|
||||||
return list
|
return list
|
||||||
|
@ -208,6 +207,6 @@ def test():
|
||||||
print as
|
print as
|
||||||
list = ncl.Listdir(fh)
|
list = ncl.Listdir(fh)
|
||||||
for item in list: print item
|
for item in list: print item
|
||||||
mcl.Unmnt(filesys)
|
mcl.Umnt(filesys)
|
||||||
|
|
||||||
test()
|
test()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue