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)
+
int ceph_utime(ceph_mount_info *cmount, const char *path, utimbuf *buf)
int ceph_futime(ceph_mount_info *cmount, int fd, utimbuf *buf)
int ceph_utimes(ceph_mount_info *cmount, const char *path, timeval times[2])
int ceph_lutimes(ceph_mount_info *cmount, const char *path, timeval times[2])
int ceph_futimes(ceph_mount_info *cmount, int fd, timeval times[2])
int ceph_futimens(ceph_mount_info *cmount, int fd, timespec times[2])
+ int ceph_utimensat(ceph_mount_info* cmount, int fd, const char* relpath,
+ timespec* times, int flags)
+
int ceph_get_file_replication(ceph_mount_info *cmount, int fh)
int ceph_get_path_replication(ceph_mount_info *cmount, const char *path)
int ceph_get_pool_id(ceph_mount_info *cmount, const char *pool_name)
if ret < 0:
raise make_ex(ret, "error in futimens")
+ def utimensat(self, fd, relpath, times, flags):
+ """
+ Set access and modification time for a file pointer by descriptor
+
+ :param fd: file descriptor of the open file
+ :param relpath: path relative to file descriptor
+ :param times: if times is not None, it must be a tuple (atime, mtime)
+ :param flags: int value that can be used to set AT_* modifier flags
+ (AT_SYMLINK_NOFOLLOW)
+ """
+ self.require_state("mounted")
+
+ if not isinstance(fd, int):
+ raise TypeError('"fd" must be an int')
+ if not isinstance(flags, int):
+ raise TypeError('"flags" must be an int')
+
+ if not isinstance(times, tuple):
+ raise TypeError('times must be a tuple')
+ if not isinstance(times[0], (int, float)):
+ raise TypeError('atime must be an int or a float')
+ if not isinstance(times[1], (int, float)):
+ raise TypeError('mtime must be an int or a float')
+
+ ac_time = float(times[0])
+ mod_time = float(times[1])
+
+ relpath = cstr(relpath, 'relpath')
+ cdef:
+ int _fd = fd
+ char* _relpath = relpath
+ timespec* _times = [to_timespec(ac_time), to_timespec(mod_time)]
+ int _flags = flags
+
+ with nogil:
+ ret = ceph_utimensat(self.cluster, _fd, _relpath, _times, _flags)
+
+ if ret < 0:
+ raise make_ex(ret, "error in utimensat")
+
def get_file_replication(self, fd):
"""
Get the file replication information from an open file descriptor.
pass
int ceph_futimens(ceph_mount_info *cmount, int fd, timespec times[2]):
pass
+ int ceph_utimensat(ceph_mount_info* cmount, int fd, const char* relpath,
+ timespec* times, int flags):
+ pass
+
int ceph_get_file_replication(ceph_mount_info *cmount, int fh):
pass
int ceph_get_path_replication(ceph_mount_info *cmount, const char *path):