在 C# 中使用 NFSPROC3_READDIRPLUS
Using NFSPROC3_READDIRPLUS in C#
我正在为 NFS 使用此 C# 客户端的源代码:
一切正常,但有一个功能我似乎无法成功调用。
有两个列出文件夹项目的函数:READDIR 和 READDIRPLUS
基本上,READDIR 仅 returns 路径,READDIRPLUS 返回所有其他属性。
http://pubs.opengroup.org/onlinepubs/9629799/NFSPROC3_READDIRPLUS.htm
在调用READDIRPLUS时,有两个额外的参数我不明白如何使用:
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.
有没有人成功调用过这个函数?
READDIRPLUS 在 nfsv3 之后的版本中非常常见。
dircount 和 maxcount 是作为一种优化而引入的,目的是清楚地告诉服务器客户端真正想要什么。表示每个回复中需要多少条目,以及回复到来时客户端为每个条目的属性分配了多少内存。
如果客户端想要读取完整的目录条目,它必须循环发送 readdirplus 请求,直到回复显示 eof=1(文件结束)。
因此客户可以决定 dircount 和 maxcount 的值。通常客户使用 8k 作为 dircount,32k 作为 maxcount。但它是实现定义的。
我最终修复了开源库:
https://github.com/DeCoRawr/NFSClient/tree/master-READDIRPLUS_for_V3?files=1
有一个单独的分支使用 ReadirPlus for NFS v3。
如果有人需要这个,很容易将 NFS 库与 GUI 客户端分开。
我正在为 NFS 使用此 C# 客户端的源代码:
一切正常,但有一个功能我似乎无法成功调用。 有两个列出文件夹项目的函数:READDIR 和 READDIRPLUS 基本上,READDIR 仅 returns 路径,READDIRPLUS 返回所有其他属性。
http://pubs.opengroup.org/onlinepubs/9629799/NFSPROC3_READDIRPLUS.htm
在调用READDIRPLUS时,有两个额外的参数我不明白如何使用:
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.
有没有人成功调用过这个函数?
READDIRPLUS 在 nfsv3 之后的版本中非常常见。 dircount 和 maxcount 是作为一种优化而引入的,目的是清楚地告诉服务器客户端真正想要什么。表示每个回复中需要多少条目,以及回复到来时客户端为每个条目的属性分配了多少内存。 如果客户端想要读取完整的目录条目,它必须循环发送 readdirplus 请求,直到回复显示 eof=1(文件结束)。 因此客户可以决定 dircount 和 maxcount 的值。通常客户使用 8k 作为 dircount,32k 作为 maxcount。但它是实现定义的。
我最终修复了开源库:
https://github.com/DeCoRawr/NFSClient/tree/master-READDIRPLUS_for_V3?files=1
有一个单独的分支使用 ReadirPlus for NFS v3。 如果有人需要这个,很容易将 NFS 库与 GUI 客户端分开。