Displaying 20 results from an estimated 71 matches for "guestfs_download".
2017 Feb 13
2
Re: Extract VHD using guestfs
Thanks a lot. I was trying to copy on local disk and guestfs_download ()
solved my problem.
Now I am trying to modify source code of guestfs_download () to extract
file in memory. Can you guide me what should i do to achieve that.
Mohsin
On Fri, Feb 10, 2017 at 2:13 AM, Richard W.M. Jones <rjones@redhat.com>
wrote:
> On Thu, Feb 09, 2017 at 03:24:53PM +0...
2017 Feb 09
3
Extract VHD using guestfs
Hi,
I have tried to extract *.vhd* file using guestfs library. I am able to
list all files inside my archive using *guestfs_ls* also
* guestfs_list_filesystems()* retruns right File system information. I am
trying to extract files from inside archive using
*guestfs_copy_device_to_file()
* but it returns following error (error: copy_device_to_file: unknown
option 689330304 (this can happen if a
2017 Feb 09
0
Re: Extract VHD using guestfs
...quot;/home/mohsin/VHD/");
> guestfs_ls(g, "/");
> guestfs_copy_device_to_file(g, "/dev/sda1/file-to extract.exe", "/abc.exe");
It's actually not clear to me what you're trying to achieve here.
Download the file to the local host? If so use guestfs_download:
guestfs_download (g, "/file-to-extract.exe", "local-file.exe");
BTW you should check for errors from C API calls.
http://libguestfs.org/guestfs.3.html#downloading
http://libguestfs.org/guestfs.3.html#error-handling
Rich.
--
Richard Jones, Virtualization Group, Red H...
2015 Mar 11
1
Re: Name resolution not working inside virt-customize
On 03/10/2015 05:12 PM, Richard W.M. Jones wrote:
> Just for comparison, libguestfs 1.29.29 on Fedora host, plus
> virt-builder, with a Fedora guest does this:
Hmm, something weird is going in with the output of virt-customize.
leer@eng-leer:~$ virt-customize -a
trusty-server-cloudimg-amd64-disk1.img --firstboot update-resolv-conf.sh
--install mysql-server -v -x > virt-customize.log
2009 Aug 05
1
[PATCH] Compute MD5 of COPYING.LIB used in upload and download tests
...t;checksum"; "md5"; "/COPYING.LIB"]],
+ Digest.to_hex (Digest.file "COPYING.LIB"))],
"upload a file from the local machine",
"\
Upload local file C<filename> to C<remotefilename> on the
@@ -1772,7 +1773,8 @@ See also C<guestfs_download>.");
[["upload"; "../COPYING.LIB"; "/COPYING.LIB"];
["download"; "/COPYING.LIB"; "testdownload.tmp"];
["upload"; "testdownload.tmp"; "/upload"];
- ["checksum"; &q...
2014 Jun 23
2
[PATCH] cat: add -m option
...rgv[optind]);
+ else
+ r = do_cat_simple (argc - optind, &argv[optind]);
guestfs_close (g);
@@ -283,6 +300,20 @@ do_cat (int argc, char *argv[])
}
static int
+do_cat_simple (int argc, char *argv[])
+{
+ unsigned errors = 0;
+ int i;
+
+ for (i = 0; i < argc; ++i) {
+ if (guestfs_download (g, argv[i], "/dev/stdout") == -1)
+ errors++;
+ }
+
+ return errors == 0 ? 0 : -1;
+}
+
+static int
is_windows (guestfs_h *g, const char *root)
{
char *type;
diff --git a/cat/virt-cat.pod b/cat/virt-cat.pod
index 9824a83..e06a961 100644
--- a/cat/virt-cat.pod
+++ b/cat/virt-c...
2019 Jun 28
2
Re: Guestfish command - "copy-out" not working for symbolic links
...vanets <stenavin@gmail.com>
Sent: Friday, June 28, 2019 10:58 AM
To: Chintan Patel
Cc: Chintan Patel; libguestfs@redhat.com
Subject: Re: [Libguestfs] Guestfish command - "copy-out" not working for symbolic links
Chintan,
Use 'download' (http://libguestfs.org/guestfs.3.html#guestfs_download)
--
Mykola Ivanets
пт, 28 черв. 2019, 18:55 користувач Chintan Patel <chintan.r.patel@outlook.com<mailto:chintan.r.patel@outlook.com>> пише:
Hi Nikolay,
We use guestfish, so I preferred to use commands supported by guestfish.
I tried as below but "realpath" is not working...
2015 May 26
2
[PATCH] api: Don't truncate /dev/stdout or /dev/stderr when used as FileOut.
In APIs such as guestfs_download, when the FileOut parameter exactly
matches "/dev/stdout" or "/dev/stderr", don't reopen the possibly
redirected output file with O_TRUNC (truncate). Instead dup the file
descriptor.
This magic behaviour doesn't happen for /dev/fd/* (or any other output
file) allowing...
2019 Jun 28
2
Re: Guestfish command - "copy-out" not working for symbolic links
...10:58 AM
>> To: Chintan Patel
>> Cc: Chintan Patel; libguestfs@redhat.com
>> Subject: Re: [Libguestfs] Guestfish command - "copy-out" not working for symbolic links
>>
>> Chintan,
>>
>> Use 'download' (http://libguestfs.org/guestfs.3.html#guestfs_download)
>>
>> --
>> Mykola Ivanets
>>
>> пт, 28 черв. 2019, 18:55 користувач Chintan Patel <chintan.r.patel@outlook.com> пише:
>>
>> Hi Nikolay,
>>
>> We use guestfish, so I preferred to use commands supported by guestfish.
>> I tried as...
2014 Jun 23
2
Re: [PATCH] cat: add -m option
...wrote:
> On Mon, Jun 23, 2014 at 01:00:11PM +0200, Pino Toscano wrote:
> > static int
> >
> > +do_cat_simple (int argc, char *argv[])
> > +{
> > + unsigned errors = 0;
> > + int i;
> > +
> > + for (i = 0; i < argc; ++i) {
> > + if (guestfs_download (g, argv[i], "/dev/stdout") == -1)
> > + errors++;
> > + }
> > +
> > + return errors == 0 ? 0 : -1;
> > +}
>
> The problem with this function is two-fold:
>
> - It disables Windows path support if using the -m option, which
> seems...
2023 Feb 14
1
Issue with downloading files whose path contains multi-byte utf-8 characters
...0007f6dd168603a in guestfs_int_recv
> ? ? (g=g at entry=0xae06f0, fn=fn at entry=0x7f6dd16aa308 "download", hdr=hdr at entry=
> 0x7fffa95cc610, err=err at entry=0x7fffa95cc5e0, xdrp=xdrp at entry=0x0, ret=
> ret at entry=0x0)
> ? ? at proto.c:668
> #11 0x00007f6dd163825e in guestfs_download (g=g at entry=0xae06f0, remotefilename=
> <optimized out>, filename=0x7f6dd17edea0 "/tmp/1") at actions-5.c:2984
> #12 0x00007f6dd17ab01a in guestfs_int_py_download (self=<optimized out>, args=
> <optimized out>) at actions-5.c:794
> ?
>
>
> On Mon...
2016 Dec 11
3
[PATCH 0/2] generic function for temporary path generation
Cosmetic change as suggested in this previous patch:
https://www.redhat.com/archives/libguestfs/2016-November/msg00111.html
Matteo Cafasso (2):
lib: generic function for temporary path generation
lib: use guestfs_int_make_temp_path to generate temporary files
src/drives.c | 5 ++---
src/file.c | 22 +++++++++-------------
src/guestfs-internal.h | 1 +
src/journal.c
2019 Jun 28
0
Re: Guestfish command - "copy-out" not working for symbolic links
Chintan,
Use 'download' (http://libguestfs.org/guestfs.3.html#guestfs_download)
--
Mykola Ivanets
пт, 28 черв. 2019, 18:55 користувач Chintan Patel <
chintan.r.patel@outlook.com> пише:
> Hi Nikolay,
>
> We use guestfish, so I preferred to use commands supported by guestfish.
> I tried as below but "realpath" is not working after I have the tar...
2010 Sep 20
2
[PATCH 0/2] Implement upload-offset, download-offset APIs, and hexedit guestfish command
This two-part patch implements the 'hexedit' command described here:
http://rwmj.wordpress.com/2010/09/18/new-feature-guestfish-hexedit/#content
The first part implements two new APIs for partial writing and reading
of files. These are modelled after guestfs_upload and
guestfs_download but allow you to specify an offset and (for download
only) a size:
int guestfs_download_offset (guestfs_h *g,
const char *remotefilename, const char *filename,
int64_t offset, int64_t size);
int guestfs_upload_offset (guestfs_h *g,
const char *filename, const char *remotefilename,
int64_t...
2019 Jun 28
0
Re: Guestfish command - "copy-out" not working for symbolic links
...ay, June 28, 2019 10:58 AM
> *To:* Chintan Patel
> *Cc:* Chintan Patel; libguestfs@redhat.com
> *Subject:* Re: [Libguestfs] Guestfish command - "copy-out" not working
> for symbolic links
>
> Chintan,
>
> Use 'download' (http://libguestfs.org/guestfs.3.html#guestfs_download)
>
> --
> Mykola Ivanets
>
> пт, 28 черв. 2019, 18:55 користувач Chintan Patel <
> chintan.r.patel@outlook.com> пише:
>
> Hi Nikolay,
>
> We use guestfish, so I preferred to use commands supported by guestfish.
> I tried as below but "realpath" is...
2019 Jun 28
0
Re: Guestfish command - "copy-out" not working for symbolic links
...10:58 AM
>> To: Chintan Patel
>> Cc: Chintan Patel; libguestfs@redhat.com
>> Subject: Re: [Libguestfs] Guestfish command - "copy-out" not working for symbolic links
>>
>> Chintan,
>>
>> Use 'download' (http://libguestfs.org/guestfs.3.html#guestfs_download)
>>
>> --
>> Mykola Ivanets
>>
>> пт, 28 черв. 2019, 18:55 користувач Chintan Patel <chintan.r.patel@outlook.com> пише:
>>
>> Hi Nikolay,
>>
>> We use guestfish, so I preferred to use commands supported by guestfish.
>> I tried as...
2016 Dec 11
0
[PATCH 2/2] lib: use guestfs_int_make_temp_path to generate temporary files
..._t *size_r)
char *ret = NULL;
struct stat statbuf;
- if (guestfs_int_lazy_make_tmpdir (g) == -1)
+ tmpfile = guestfs_int_make_temp_path (g, "cat");
+ if (tmpfile == NULL)
goto err;
- tmpfile = safe_asprintf (g, "%s/cat%d", g->tmpdir, ++g->unique);
-
if (guestfs_download (g, path, tmpfile) == -1)
goto err;
@@ -213,11 +212,10 @@ guestfs_impl_find (guestfs_h *g, const char *directory)
char **ret = NULL;
size_t i, count, size;
- if (guestfs_int_lazy_make_tmpdir (g) == -1)
+ tmpfile = guestfs_int_make_temp_path (g, "find");
+ if (tmpfile == NU...
2015 May 26
6
[PATCH 0/6] Update the way that API versions are generated for the man page.
The existing mechanism was clunky, slow and used ~ 10 MB of
local disk.
Rich.
2012 Jan 16
1
[PATCH] generator: Add an explicit Cancellable flag
...otefilename"], []), 66,
+ [Progress; Cancellable],
[InitScratchFS, Always, TestOutput (
(* Pick a file from cwd which isn't likely to change. *)
[["mkdir"; "/upload"];
@@ -2730,7 +2731,8 @@ C<filename> can also be a named pipe.
See also C<guestfs_download>.");
- ("download", (RErr, [Dev_or_Path "remotefilename"; FileOut "filename"], []), 67, [Progress],
+ ("download", (RErr, [Dev_or_Path "remotefilename"; FileOut "filename"], []), 67,
+ [Progress; Cancellable],
[InitScratc...
2019 Jun 28
1
Re: Guestfish command - "copy-out" not working for symbolic links
Hi Nikolay,
We use guestfish, so I preferred to use commands supported by guestfish.
I tried as below but "realpath" is not working after I have the target path from symlink.
--> Check if the path has a symlink.
is-symlink path
Ex. - is-symlink "/etc/resolv.conf" -> return true
--> If it's true then get target link path
readlink path
ex. - readlink