[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Libguestfs] Extract VHD using guestfs



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

Attachment: signature.asc
Description: This is a digitally signed message part.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]