views:

128

answers:

1

Hello.

I'm looking for some stand alone library to access NFS shares. I am not looking for mounting the shares, just browsing and accessing the files for reading.

Preferable something with a simple simple API similar to regular POSIX operations of opendir, scandir, read and etc.

Thanks in advance!

A: 

Here's a link to this NFS client library, but it looks promising, to quote:

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

Here is another link that might explain the limitation of the 256 files opened simultaneously here on sourceforge.net, see B3 of the FAQ there on sourceforge...

Edit: Here's a question that was posted here on Stackoverflow in respect to recursively reading a directory that could be easily modified to scandir...

tommieb75
thanks, i should've mentioned that i've found that library as well.unfortunately it provides a incredibly basic API and doesn't allow operations like `scandir`. it's a deal breaker :(
Reflog
You can incorporate a simple scandir by using opendir, readdir, and closedir in recursive fashion....
tommieb75
all those points are clear, but the library in question has no support for `opendir` and `readdir`.
Reflog