0

I am using the source code of this C# Client for NFS:

https://github.com/DeCoRawr/NFSClient

Everything is working fine, but there is on function I can't seem to call successfully. There are two functions which list folder items: READDIR and READDIRPLUS Basically, READDIR only returns paths, READDIRPLUS returnes all other attributes.

http://pubs.opengroup.org/onlinepubs/9629799/NFSPROC3_READDIRPLUS.htm

When calling READDIRPLUS, there are two extra paramters that I can't understand how to use:

dircount The maximum number of bytes of directory information to be returned. This number does not include the size of the attributes and file handle portions of the result.

maxcount The maximum size of the READDIRPLUS3resok structure, in bytes. The size must include all XDR overhead. The server may return fewer than maxcount bytes of data. No matter what I try, I can't seem to get it right.

Did anybody ever call this function succesfully?

Community
  • 1
  • 1
Roman
  • 91
  • 10

2 Answers2

1

READDIRPLUS is very common in nfsv3 version onwards. dircount and maxcount are introduced as an optimization and to tell server clearly what client really wants. Means how many entries it wants in every reply and how much memory client has allocated for attributes of each entry when reply comes. if client wants to read the full directory entries, it has to send readdirplus request in a loop until the reply shows eof=1 (end of file). So client can decide on values of dircount and maxcount. Often clients use 8k for dircount and 32k as maxcount. But it is implementation defined.

rskishore
  • 21
  • 2
0

I ended up fixing the open source library:

https://github.com/DeCoRawr/NFSClient/tree/master-READDIRPLUS_for_V3?files=1

There is a separate branch that uses ReadirPlus for NFS v3. If anybody needs this, it is quite eady to separate the NFS Library from the GUI client.

Roman
  • 91
  • 10