diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2010-12-17 18:56:15 +0000 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2010-12-17 18:56:42 +0000 |
commit | acd25281bfa31b78fd03e25b495f66138a4dd987 (patch) | |
tree | 5b9ff582284a22a4035c6280c434a5495864021a | |
parent | fa4931bc4e2944e9b3b72843d4b0350d7ad36238 (diff) | |
download | libguestfs-acd25281bfa31b78fd03e25b495f66138a4dd987.tar.gz libguestfs-acd25281bfa31b78fd03e25b495f66138a4dd987.tar.xz libguestfs-acd25281bfa31b78fd03e25b495f66138a4dd987.zip |
docs: Add section on using /dev/fd/* with upload and download calls.
-rw-r--r-- | src/guestfs.pod | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/guestfs.pod b/src/guestfs.pod index bb90de88..7d2f91c8 100644 --- a/src/guestfs.pod +++ b/src/guestfs.pod @@ -334,6 +334,27 @@ Use L</guestfs_download>. See L</DOWNLOADING> above. =back +=head2 UPLOADING AND DOWNLOADING TO PIPES AND FILE DESCRIPTORS + +Calls like L</guestfs_upload>, L</guestfs_download>, +L</guestfs_tar_in>, L</guestfs_tar_out> etc appear to only take +filenames as arguments, so it appears you can only upload and download +to files. However many Un*x-like hosts let you use the special device +files C</dev/stdin>, C</dev/stdout>, C</dev/stderr> and C</dev/fd/N> +to read and write from stdin, stdout, stderr, and arbitrary file +descriptor N. + +For example, L<virt-cat(1)> writes its output to stdout by +doing: + + guestfs_download (filename, "/dev/stdout"); + +and you can write tar output to a pipe C<fd> by doing: + + char devfd[64]; + snprintf (devfd, sizeof devfd, "/dev/fd/%d", fd); + guestfs_tar_out ("/", devfd); + =head2 LISTING FILES L</guestfs_ll> is just designed for humans to read (mainly when using |