Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NFS Client library

Tags:

posix

client

nfs

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!

like image 707
reflog Avatar asked Mar 14 '10 15:03

reflog


People also ask

What are NFS clients?

The computers that are accessing that file system are said to be clients. The NFS service enables any given computer to access any other computer's file systems and, at the same time, to provide access to its own file systems. A computer can play the role of client, server, or both at any given time on a network.

What is NFS in Python?

pyNfsClient is a generic open source toolkit for Linux NFS file system simulation as client. Constructed parameters sent via RPC and then analyse the response in reference to NFS protocol specifications (RFC1813). You could form your custom scenarios that consist of basic actions to meet expecations.


1 Answers

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

like image 181
t0mm13b Avatar answered Oct 17 '22 08:10

t0mm13b