Search code examples
c#nfsnfsclient

Using NFSPROC3_READDIRPLUS in C#


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?


Solution

  • 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.