Comments (7)
Linux uses st_atim.tv_sec and st_atim.tv_nsec instead of st_atime
nowadays.
Try using those instead of st_atime
On Wed, Oct 5, 2016 at 12:33 AM, dhanumuli [email protected] wrote:
I've following code for reading NFS directory contents
#pythonimport libnfs
nfsh = libnfs.NFS('nfs:///folder1/')
d = libnfs.new_NFSDirHandle()
ret = libnfs.nfs_opendir(nfsh._nfs, '/', d)
if ret == -libnfs.errno.ENOENT:
raise IOError(libnfs.errno.ENOENT, 'No such file or directory');
d = libnfs.NFSDirHandle_value(d)
dirEntry = libnfs.nfs_readdir(nfsh._nfs, d)
print dirEntry.name
abc --> attribute printed correctly
print dirEntry.mtime
swig/python detected a memory leak of type 'struct timeval *', no
destructor found.I tried to access the mtime through various ways but was unable to do so.
All other attributes except mtime, atime, ctime are printed correctly. For
the time attributes only I get the above mentioned error.Can you please help in understanding what's wrong here?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#11, or mute the thread
https://github.com/notifications/unsubscribe-auth/AAeNkP0lVjHX-WoCAp8b2-Bf_dyM6kTnks5qw1KsgaJpZM4KOf4Q
.
from libnfs-python.
I don't think the problem is with st_atime.
I modified libnfs.i code to return atime.tv_sec directly instead of struct timeval (changed datatype of atime in struct nfsdirent from struct timeval to uint64_t). Made the corresponding change in C libnfs library code also.
My modified code prints the tv_sec value correctly (through atime directly). It is only when struct timeval atime value is tried to access in python, I hit the " swig/python detected a memory leak of type 'struct timeval *', no destructor found." error and no value is printed. Trying to print atime.tv_sec, atime.seconds also fails. dir() on atime also does not give any useful field which can return tv_sec value.
from libnfs-python.
I tried with ubuntu 12.04 LTS and I am getting the same error as earlier. Your original documentation mentions that you have tested on ubuntu 10 but I am not sure whether it will work on ubuntu 10 as well.
From this link, I think the problem could be returning a struct instead of struct pointer (for atime, mtime, ctime). I could be wrong so can you please confirm?
Once problem is confirmed, I can work on the fix. I tried changing struct timeval for atime to struct timeval * atime but it is giving segmentation fault. Debugging it further.
from libnfs-python.
Referring to my last comment, when I included struct timedef definition in libnfs.i file, my code works absolutely fine (gives correct values of struct timeval atime, mtime and ctime).
However, the problem there is, tv_sec and tv_usec in struct timeval are defined as __time_t and __suseconds_t which are defined as __SLONGWORD_TYPE which is defined in sys/types.h as
#define __SLONGWORD_TYPE long int
To make the code work, i've defined struct timeval in libnfs.i as follows
struct timeval {
long int tv_sec;
long int tv_usec;
};
which cannot be acceptable due to porting and compatibility.
Any pointers to how this can be solved?
from libnfs-python.
On Tue, Oct 18, 2016 at 12:18 AM, dhanumuli [email protected]
wrote:
Referring to my last comment, when I included struct timedef definition in
libnfs.i file, my code works absolutely fine (gives correct values of
struct timeval atime, mtime and ctime).However, the problem there is, tv_sec and tv_usec in struct timeval are
defined as __time_t and __suseconds_t which are defined as __SLONGWORD_TYPE
which is defined in sys/types.h as
#define __SLONGWORD_TYPE long intTo make the code work, i've defined struct timeval in libnfs.i as follows
struct timeval {
long int tv_sec;
long int tv_usec;
};
which cannot be acceptable due to porting and compatibility.
Maybe this is what needs to be done.
Please send me a pull request for this and I will merge and try to figure
ut what to do about other platforms.
Can you also try out the utils/nfs-ls.py tool and see how it works ?
Any pointers to how this can be solved?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#11 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAeNkOk3wT81Vq9vT80NpnQfPmq22_hmks5q1HLGgaJpZM4KOf4Q
.
from libnfs-python.
I've already submitted pull request for the same #12
from libnfs-python.
Merged
from libnfs-python.
Related Issues (20)
- Support nfs_readlink2()
- Support struct timeval parameters to nfs_utimes() and nfs_lutimes() HOT 1
- no timeout with errror nfs addr HOT 1
- Fails to connect to Amazon ElasticFileSystem (EFS) HOT 8
- Cannot install this library on Mac OS High Sierra HOT 1
- Does this project supports nfs version=4.1? HOT 5
- pip install libnfs report error
- can't open nfs server file ValueError: open failed: Input/output error HOT 1
- Ability to configure nfs blksize
- utils/nfs-ls.py is hanging HOT 1
- NFS.listdir waits indefinitely
- ImportError: libnfs.so.13: cannot open shared object file: No such file or directory HOT 2
- NFS object does not have attribute isdir, isfile ect. HOT 1
- weither close nfs connetion HOT 1
- Didn't found NFS?
- Attribute Error
- Error while compiling and error while "python3 setup.py install" HOT 1
- module hangs forever in nfs.open HOT 2
- symbol not found in flat namespace '_free_nfs_srvr_list'
- fatal error C1083: Cannot open include file: 'nfsc/libnfs.h' - Problem with libnfs installation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libnfs-python.