summaryrefslogtreecommitdiffstats
path: root/perl
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2009-06-29 12:47:20 +0100
committerRichard W.M. Jones <rjones@redhat.com>2009-06-29 12:47:20 +0100
commite492608f2f3809a824cb70ee03ff305964b69dd7 (patch)
tree953ec56c34431549dab177eec9e0fe979606e5eb /perl
parent9a92446bcad09b492dee42dd5950bac67073fbea (diff)
downloadlibguestfs-e492608f2f3809a824cb70ee03ff305964b69dd7.tar.gz
libguestfs-e492608f2f3809a824cb70ee03ff305964b69dd7.tar.xz
libguestfs-e492608f2f3809a824cb70ee03ff305964b69dd7.zip
Generated code for 'du' command.
Diffstat (limited to 'perl')
-rw-r--r--perl/Guestfs.xs14
-rw-r--r--perl/lib/Sys/Guestfs.pm12
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