From bb07a7f858da5d07c57360e62c0ddfd24ce6be45 Mon Sep 17 00:00:00 2001 From: Richard Jones Date: Sat, 18 Apr 2009 22:33:15 +0100 Subject: Begin to add the upload and download commands. --- perl/Guestfs.xs | 24 ++++++++++++++++++++++++ perl/lib/Sys/Guestfs.pm | 18 ++++++++++++++++++ 2 files changed, 42 insertions(+) (limited to 'perl') diff --git a/perl/Guestfs.xs b/perl/Guestfs.xs index e4a1b502..e498842d 100644 --- a/perl/Guestfs.xs +++ b/perl/Guestfs.xs @@ -1297,3 +1297,27 @@ PREINIT: if (r == -1) croak ("blockdev_rereadpt: %s", guestfs_last_error (g)); +void +upload (g, filename, remotefilename) + guestfs_h *g; + char *filename; + char *remotefilename; +PREINIT: + int r; + PPCODE: + r = guestfs_upload (g, filename, remotefilename); + if (r == -1) + croak ("upload: %s", guestfs_last_error (g)); + +void +download (g, remotefilename, filename) + guestfs_h *g; + char *remotefilename; + char *filename; +PREINIT: + int r; + PPCODE: + r = guestfs_download (g, remotefilename, filename); + if (r == -1) + croak ("download: %s", guestfs_last_error (g)); + diff --git a/perl/lib/Sys/Guestfs.pm b/perl/lib/Sys/Guestfs.pm index 71223145..f624c246 100644 --- a/perl/lib/Sys/Guestfs.pm +++ b/perl/lib/Sys/Guestfs.pm @@ -389,6 +389,15 @@ The first character of C string must be a C<-> (dash). C can be NULL. +=item $h->download ($remotefilename, $filename); + +Download file C and save it as C +on the local machine. + +C can also be a named pipe. + +See also C<$h-Eupload>, C<$h-Ecat>. + =item $existsflag = $h->exists ($path); This returns C if and only if there is a file, directory @@ -742,6 +751,15 @@ This unmounts all mounted filesystems. Some internal mounts are not unmounted by this call. +=item $h->upload ($filename, $remotefilename); + +Upload local file C to C on the +filesystem. + +C can also be a named pipe. + +See also C<$h-Edownload>. + =item $h->vgcreate ($volgroup, \@physvols); This creates an LVM volume group called C -- cgit