NFS客户端库

时间:2010-03-14 15:51:39

标签: client posix nfs

我正在寻找一些独立的库来访问NFS共享。 我不是在寻找安装共享,只是浏览和访问文件以供阅读。

优先使用简单的API,类似于opendirscandirread等的常规POSIX操作。

提前致谢!

2 个答案:

答案 0 :(得分:4)

这是NFS client library的链接,但它看起来很有希望,引用:

The NFS client handles only one connection at a time, but no connection takes 
very long. 

Read requests must be for under 8000 bytes. This has to do with packet size. 
You don't want to know. 

Once 256 files are open simultaneously -- by all applications, since the client 
does not discriminate between requests in any way -- file handles begin to be 
overwritten. The client prints an error. 

If the client has problems opening sockets it quits gracefully, including 
returning a message over the socket to the application. The exception is if 
it is given a bad hostname to mount, in which case it just responds with failure 
rather than quitting. 

If the formatting of the code looks messed up, it's because the code was written 
half on a Mac (tab = 4 spaces).

这是另一个链接,可以解释同时在sourceforge.net打开的256个文件的限制,请参阅sourceforge上的常见问题解答B3 ...

编辑:以下是Stackoverflow上发布的关于递归阅读可轻易修改为scandir的目录的问题...

答案 1 :(得分:2)

现在github上有一个libnfs库:https://github.com/sahlberg/libnfs
我看到它有DebianFreeBSD个包。