libnfs-python icon indicating copy to clipboard operation
libnfs-python copied to clipboard

NFS object does not have attribute isdir, isfile ect.

Open cnc0090306 opened this issue 4 years ago • 1 comments

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']

cnc0090306 avatar Apr 20 '21 06:04 cnc0090306

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

sahlberg avatar Apr 20 '21 07:04 sahlberg