diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2009-06-29 12:47:20 +0100 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2009-06-29 12:47:20 +0100 |
commit | e492608f2f3809a824cb70ee03ff305964b69dd7 (patch) | |
tree | 953ec56c34431549dab177eec9e0fe979606e5eb /perl | |
parent | 9a92446bcad09b492dee42dd5950bac67073fbea (diff) | |
download | libguestfs-e492608f2f3809a824cb70ee03ff305964b69dd7.tar.gz libguestfs-e492608f2f3809a824cb70ee03ff305964b69dd7.tar.xz libguestfs-e492608f2f3809a824cb70ee03ff305964b69dd7.zip |
Generated code for 'du' command.
Diffstat (limited to 'perl')
-rw-r--r-- | perl/Guestfs.xs | 14 | ||||
-rw-r--r-- | perl/lib/Sys/Guestfs.pm | 12 |
2 files changed, 26 insertions, 0 deletions
diff --git a/perl/Guestfs.xs b/perl/Guestfs.xs index 6980bdac..d6ef053d 100644 --- a/perl/Guestfs.xs +++ b/perl/Guestfs.xs @@ -2798,3 +2798,17 @@ PREINIT: OUTPUT: RETVAL +SV * +du (g, path) + guestfs_h *g; + char *path; +PREINIT: + int64_t sizekb; + CODE: + sizekb = guestfs_du (g, path); + if (sizekb == -1) + croak ("du: %s", guestfs_last_error (g)); + RETVAL = my_newSVll (sizekb); + OUTPUT: + RETVAL + diff --git a/perl/lib/Sys/Guestfs.pm b/perl/lib/Sys/Guestfs.pm index 69ffe8b3..655624a9 100644 --- a/perl/lib/Sys/Guestfs.pm +++ b/perl/lib/Sys/Guestfs.pm @@ -549,6 +549,18 @@ Setting C<whattodrop> to 3 should drop everything. This automatically calls L<sync(2)> before the operation, so that the maximum guest memory is freed. +=item $sizekb = $h->du ($path); + +This command runs the C<du -s> command to estimate file space +usage for C<path>. + +C<path> can be a file or a directory. If C<path> is a directory +then the estimate includes the contents of the directory and all +subdirectories (recursively). + +The result is the estimated size in I<kilobytes> +(ie. units of 1024 bytes). + =item $h->e2fsck_f ($device); This runs C<e2fsck -p -f device>, ie. runs the ext2/ext3 |