int ceph_chown(ceph_mount_info *cmount, const char *path, int uid, int gid)
int ceph_lchown(ceph_mount_info *cmount, const char *path, int uid, int gid)
int ceph_fchown(ceph_mount_info *cmount, int fd, int uid, int gid)
+ int ceph_chownat(ceph_mount_info *cmount, int fd, const char *relpath,
+ int uid, int gid, int flags)
+
int64_t ceph_lseek(ceph_mount_info *cmount, int fd, int64_t offset, int whence)
void ceph_buffer_free(char *buf)
mode_t ceph_umask(ceph_mount_info *cmount, mode_t mode)
if ret < 0:
raise make_ex(ret, "error in fchown")
+ def chownat(self, fd, relpath, uid, gid, flags):
+ """
+ Change directory ownership
+
+ :param fd: the file descriptor
+ :param relpath: the path of the directory to change, relative to fd
+ :param uid: the uid to set
+ :param gid: the gid to set
+ :param flags: int value that can be used to set AT_* modifier flags
+ (AT_SYMLINK_NOFOLLOW and AT_EMPTY_PATH)
+ """
+ self.require_state("mounted")
+
+ if not isinstance(uid, int):
+ raise TypeError('"uid" must be an int')
+ if not isinstance(gid, int):
+ raise TypeError('"gid" must be an int')
+ if not isinstance(flags, int):
+ raise TypeError('"flags" must be an int')
+
+ relpath = cstr(relpath, 'relpath')
+ cdef:
+ int _fd = fd
+ char* _relpath = relpath
+ # Avoid "OverflowError: can't convert negative value to uid_t."
+ uid_t _uid = uid if uid >= 0 else -1
+ # Avoid "OverflowError: can't convert negative value to gid_t."
+ gid_t _gid = gid if gid >= 0 else -1
+ int _flags = flags
+
+ with nogil:
+ ret = ceph_chownat(self.cluster, _fd, _relpath, _uid, _gid, _flags)
+ if ret < 0:
+ raise make_ex(ret, f"error in chownat {relpath.decode('utf-8')}")
+
def mkdirs(self, path, mode):
"""
Create multiple directories at once.
pass
int ceph_fchown(ceph_mount_info *cmount, int fd, int uid, int gid):
pass
+ int ceph_chownat(ceph_mount_info *cmount, int fd, const char *relpath,
+ int uid, int gid, int flags):
+ pass
+
int64_t ceph_lseek(ceph_mount_info *cmount, int fd, int64_t offset, int whence):
pass
void ceph_buffer_free(char *buf):
pass
mode_t ceph_umask(ceph_mount_info *cmount, mode_t mode):
pass
+
int ceph_utime(ceph_mount_info *cmount, const char *path, utimbuf *buf):
pass
int ceph_futime(ceph_mount_info *cmount, int fd, utimbuf *buf):