int ceph_conf_set(ceph_mount_info *cmount, const char *option, const char *value)
int ceph_mount(ceph_mount_info *cmount, const char *root)
+ int ceph_fstat(ceph_mount_info *cmount, int fd, stat *stbuf)
int ceph_stat(ceph_mount_info *cmount, const char *path, stat *stbuf)
int ceph_statfs(ceph_mount_info *cmount, const char *path, statvfs *stbuf)
st_mtime=datetime.fromtimestamp(statbuf.st_mtime),
st_ctime=datetime.fromtimestamp(statbuf.st_ctime))
+ def fstat(self, fd):
+ self.require_state("mounted")
+ if not isinstance(fd, int):
+ raise TypeError('fd must be an int')
+
+ cdef:
+ int _fd = fd
+ stat statbuf
+
+ with nogil:
+ ret = ceph_fstat(self.cluster, _fd, &statbuf)
+ if ret < 0:
+ raise make_ex(ret, "error in fsat")
+ return StatResult(st_dev=statbuf.st_dev, st_ino=statbuf.st_ino,
+ st_mode=statbuf.st_mode, st_nlink=statbuf.st_nlink,
+ st_uid=statbuf.st_uid, st_gid=statbuf.st_gid,
+ st_rdev=statbuf.st_rdev, st_size=statbuf.st_size,
+ st_blksize=statbuf.st_blksize,
+ st_blocks=statbuf.st_blocks,
+ st_atime=datetime.fromtimestamp(statbuf.st_atime),
+ st_mtime=datetime.fromtimestamp(statbuf.st_mtime),
+ st_ctime=datetime.fromtimestamp(statbuf.st_ctime))
+
def symlink(self, existing, newname):
self.require_state("mounted")
existing = cstr(existing, 'existing')