summaryrefslogtreecommitdiffstats
path: root/perl
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2009-06-29 10:09:13 +0100
committerRichard W.M. Jones <rjones@redhat.com>2009-06-29 10:09:13 +0100
commitf450ce75b754fb869b34433c0126f7bb592b141b (patch)
treed5871faf1cc109629f7df0b59e1eb1403199ccf4 /perl
parent62ccc07e744d5ebfb45d9344827d36f9f61699f4 (diff)
downloadlibguestfs-f450ce75b754fb869b34433c0126f7bb592b141b.tar.gz
libguestfs-f450ce75b754fb869b34433c0126f7bb592b141b.tar.xz
libguestfs-f450ce75b754fb869b34433c0126f7bb592b141b.zip
Generated code for 'wc_*' commands.
Diffstat (limited to 'perl')
-rw-r--r--perl/Guestfs.xs42
-rw-r--r--perl/lib/Sys/Guestfs.pm15
2 files changed, 57 insertions, 0 deletions
diff --git a/perl/Guestfs.xs b/perl/Guestfs.xs
index 96b02f9b..1dc634f5 100644
--- a/perl/Guestfs.xs
+++ b/perl/Guestfs.xs
@@ -2650,3 +2650,45 @@ PREINIT:
OUTPUT:
RETVAL
+SV *
+wc_l (g, path)
+ guestfs_h *g;
+ char *path;
+PREINIT:
+ int lines;
+ CODE:
+ lines = guestfs_wc_l (g, path);
+ if (lines == -1)
+ croak ("wc_l: %s", guestfs_last_error (g));
+ RETVAL = newSViv (lines);
+ OUTPUT:
+ RETVAL
+
+SV *
+wc_w (g, path)
+ guestfs_h *g;
+ char *path;
+PREINIT:
+ int words;
+ CODE:
+ words = guestfs_wc_w (g, path);
+ if (words == -1)
+ croak ("wc_w: %s", guestfs_last_error (g));
+ RETVAL = newSViv (words);
+ OUTPUT:
+ RETVAL
+
+SV *
+wc_c (g, path)
+ guestfs_h *g;
+ char *path;
+PREINIT:
+ int chars;
+ CODE:
+ chars = guestfs_wc_c (g, path);
+ if (chars == -1)
+ croak ("wc_c: %s", guestfs_last_error (g));
+ RETVAL = newSViv (chars);
+ OUTPUT:
+ RETVAL
+
diff --git a/perl/lib/Sys/Guestfs.pm b/perl/lib/Sys/Guestfs.pm
index 83fbbb10..8871b68e 100644
--- a/perl/lib/Sys/Guestfs.pm
+++ b/perl/lib/Sys/Guestfs.pm
@@ -1391,6 +1391,21 @@ using L<qemu(1)>.
You should call this after C<$h-E<gt>launch> to wait for the launch
to complete.
+=item $chars = $h->wc_c ($path);
+
+This command counts the characters in a file, using the
+C<wc -c> external command.
+
+=item $lines = $h->wc_l ($path);
+
+This command counts the lines in a file, using the
+C<wc -l> external command.
+
+=item $words = $h->wc_w ($path);
+
+This command counts the words in a file, using the
+C<wc -w> external command.
+
=item $h->write_file ($path, $content, $size);
This call creates a file called C<path>. The contents of the