[Libguestfs] Extract VHD using guestfs
Pino Toscano
ptoscano at redhat.com
Mon Feb 13 08:58:06 UTC 2017
Hi,
On Monday, 13 February 2017 12:33:11 CET MUHAMMAD MOHSIN wrote:
> Now I am trying to modify source code of guestfs_download () to extract
> file in memory.
There is no need to do that, since there is already an API for this:
guestfs_read_file. For example, you can do:
size_t file_size = 0;
char *content = guestfs_read_file (g, "/path/in/the/guest", &file_size);
'content' will hold all the content of the file, and 'file_size' how
many bytes are in the 'content' buffer).
--
Pino Toscano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20170213/039423b5/attachment.sig>
More information about the Libguestfs
mailing list