libnfs-python
libnfs-python copied to clipboard
NFS object does not have attribute isdir, isfile ect.
nfs = libnfs.NFS('nfs://{SERVER}/{RESOURCE}/')
nfs.isdir("/{DIR}/)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'NFS' object has no attribute 'isdir'
dir(nfs)
['__class__', '__del__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_nfs', '_url', 'listdir', 'lstat', 'mkdir', 'open', 'rmdir', 'stat', 'unlink']
isdir() should be there. Maybe you are using an old version of the wrapper?
Try installing libnfs from current master and try installing libnfs-python from current master.
I just pushed a small change to libnfs-python to switch it to python3 and using current master of both libnfs and libnfs-python the nfs.isdir() method works for me in testing.
I verified that these instructions worked: This module depends on and provides bindings for libnfs, a userspace NFS library hosted at https://github.com/sahlberg/libnfs
Before you can build this module you must first install the latest version of libnfs.
Building and installing
cd libnfs make cd .. sudo python3 setup.py install