diff options
author | Richard Jones <rjones@redhat.com> | 2009-10-30 16:10:45 +0000 |
---|---|---|
committer | Richard Jones <rjones@redhat.com> | 2009-11-02 16:37:51 +0000 |
commit | 2eb19f526164a978c373a760deb30854d56b62ce (patch) | |
tree | 33798414007f6d8bdf78e6cef6a354efad642f18 /daemon/dir.c | |
parent | 00425c073e5c0743ef425cd12108a85ac36b15f4 (diff) | |
download | libguestfs-2eb19f526164a978c373a760deb30854d56b62ce.tar.gz libguestfs-2eb19f526164a978c373a760deb30854d56b62ce.tar.xz libguestfs-2eb19f526164a978c373a760deb30854d56b62ce.zip |
New API calls: truncate, truncate_size, mkdir_mode, utimens, lchown.
truncate, truncate_size: Used to truncate files to a particular
size, or to zero bytes.
mkdir_mode: Like mkdir but allows you to also specify the
initial permissions for the new directory.
utimens: Set timestamp on a file with nanosecond accuracy.
lchown: Corresponding to lchown(2) syscall (we already have chown).
The implementation is complicated by the fact that we had to
add an Int64 parameter type to the generator.
Diffstat (limited to 'daemon/dir.c')
-rw-r--r-- | daemon/dir.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/daemon/dir.c b/daemon/dir.c index 1ca62868..b603cfd0 100644 --- a/daemon/dir.c +++ b/daemon/dir.c @@ -99,6 +99,23 @@ do_mkdir (const char *path) return 0; } +int +do_mkdir_mode (const char *path, int mode) +{ + int r; + + CHROOT_IN; + r = mkdir (path, mode); + CHROOT_OUT; + + if (r == -1) { + reply_with_perror ("mkdir_mode: %s", path); + return -1; + } + + return 0; +} + static int recursive_mkdir (const char *path) { |