diff options
author | Prashanth Pai <ppai@redhat.com> | 2016-06-13 15:55:49 +0530 |
---|---|---|
committer | Prashanth Pai <ppai@redhat.com> | 2016-06-30 00:12:07 +0530 |
commit | b46451d02d2660cdf46338b2e535467bf39e5164 (patch) | |
tree | cd8f6cd68bab24e793ee139f687f5050def8ed6a /gluster/api.py | |
parent | e8229ddeca824e1cfdc2d95cc2bce3c731ea7372 (diff) |
Expose glfs_readdirplus_r
This patch does the following:
* Implements Volume.listdir_with_stat() API which internally invokes
glfs_readdirplus_r to return directory entries along with stat for
each entry.
* Implements Volume.scandir() which is similar to os.scandir() present
in Python 3.5
* Makes Dir class iterable.
* Enables Dir class to raise OSError when glfs_readdir* calls fail.
Previously, these failures were silently being ignored and treated as
a case of EOF.
Change-Id: Id918c39a7ef3882553e9bcd3fbf9455ee1c25a83
Signed-off-by: Prashanth Pai <ppai@redhat.com>
Diffstat (limited to 'gluster/api.py')
-rwxr-xr-x | gluster/api.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gluster/api.py b/gluster/api.py index e2e2966..c440de6 100755 --- a/gluster/api.py +++ b/gluster/api.py @@ -419,6 +419,12 @@ glfs_readdir_r = gfapi_prototype('glfs_readdir_r', ctypes.c_int, ctypes.POINTER(Dirent), ctypes.POINTER(ctypes.POINTER(Dirent))) +glfs_readdirplus_r = gfapi_prototype('glfs_readdirplus_r', ctypes.c_int, + ctypes.c_void_p, + ctypes.POINTER(Stat), + ctypes.POINTER(Dirent), + ctypes.POINTER(ctypes.POINTER(Dirent))) + glfs_closedir = gfapi_prototype('glfs_closedir', ctypes.c_int, ctypes.c_void_p) |