summaryrefslogtreecommitdiffstats
path: root/perl
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2009-05-01 12:16:08 +0100
committerRichard W.M. Jones <rjones@redhat.com>2009-05-01 12:16:08 +0100
commitf47dafd23186938a22d41739d9bc695c7760b912 (patch)
treea6e5bf03a63cae2eeca269505724ae5c5ba11020 /perl
parentd9ea3e8d979c3ade1b21f27083788fd33fa3b1fa (diff)
downloadlibguestfs-f47dafd23186938a22d41739d9bc695c7760b912.tar.gz
libguestfs-f47dafd23186938a22d41739d9bc695c7760b912.tar.xz
libguestfs-f47dafd23186938a22d41739d9bc695c7760b912.zip
Generated code for 'equal' command.
Diffstat (limited to 'perl')
-rw-r--r--perl/Guestfs.xs15
-rw-r--r--perl/lib/Sys/Guestfs.pm7
2 files changed, 22 insertions, 0 deletions
diff --git a/perl/Guestfs.xs b/perl/Guestfs.xs
index af543ec0..d29d5a08 100644
--- a/perl/Guestfs.xs
+++ b/perl/Guestfs.xs
@@ -1682,3 +1682,18 @@ PREINIT:
if (r == -1)
croak ("ping_daemon: %s", guestfs_last_error (g));
+SV *
+equal (g, file1, file2)
+ guestfs_h *g;
+ char *file1;
+ char *file2;
+PREINIT:
+ int equality;
+ CODE:
+ equality = guestfs_equal (g, file1, file2);
+ if (equality == -1)
+ croak ("equal: %s", guestfs_last_error (g));
+ RETVAL = newSViv (equality);
+ OUTPUT:
+ RETVAL
+
diff --git a/perl/lib/Sys/Guestfs.pm b/perl/lib/Sys/Guestfs.pm
index a13c4411..7331053e 100644
--- a/perl/lib/Sys/Guestfs.pm
+++ b/perl/lib/Sys/Guestfs.pm
@@ -484,6 +484,13 @@ 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 $equality = $h->equal ($file1, $file2);
+
+This compares the two files C<file1> and C<file2> and returns
+true if their content is exactly equal, or false otherwise.
+
+The external L<cmp(1)> program is used for the comparison.
+
=item $existsflag = $h->exists ($path);
This returns C<true> if and only if there is a file, directory