search for: remote_is_dir

Displaying 12 results from an estimated 12 matches for "remote_is_dir".

2015 Sep 29
2
Re: [PATCH 2/2] copy-in: error out early if the localpath does not exist (RHBZ#1267032)
...ame, *basename; > CLEANUP_FREE char *tar_buf = NULL; > + struct stat statbuf; > + > + if (stat (localpath, &statbuf) == -1) { > + error (g, _("source '%s' does not exist (or cannot be read)"), localpath); > + return -1; > + } > > int remote_is_dir = guestfs_is_dir (g, remotedir); > if (remote_is_dir == -1) NACK. See the patch series I just posted. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com libguestfs lets you edit vir...
2015 Sep 29
2
[PATCH 1/2] copy-in: print tar stderr when it fails
...char *remotedir) { CLEANUP_CMD_CLOSE struct command *cmd = guestfs_int_new_command (g); - int fd; + int fd, err_fd; int r; char fdbuf[64]; size_t buf_len = strlen (localpath) + 1; char buf[buf_len]; const char *dirname, *basename; + CLEANUP_FREE char *tar_buf = NULL; int remote_is_dir = guestfs_is_dir (g, remotedir); if (remote_is_dir == -1) @@ -67,7 +69,7 @@ guestfs_impl_copy_in (guestfs_h *g, const char *localpath, const char *remotedir guestfs_int_cmd_add_arg (cmd, "-"); guestfs_int_cmd_add_arg (cmd, basename); - r = guestfs_int_cmd_run_async (cmd, NULL,...
2015 Sep 30
1
[PATCH v2] copy-in: error out early if the localpath does not exist
...size_t buf_len = strlen (localpath) + 1; char buf[buf_len]; const char *dirname, *basename; + struct stat statbuf; + + if (stat (localpath, &statbuf) == -1) { + error (g, _("source '%s' does not exist (or cannot be read)"), localpath); + return -1; + } int remote_is_dir = guestfs_is_dir (g, remotedir); if (remote_is_dir == -1) -- 2.1.0
2015 Feb 02
1
Re: [PATCH 5/6] New APIs: copy-in and copy-out
...h) + 1; > + char buf[buf_len]; > + const char *dirname, *basename; > + > + if (guestfs_is_dir (g, remotedir) == -1) > + return -1; I suppose this is here to check that remotedir is a directory, but that's not what the code here does. The original guestfish code is: int remote_is_dir = guestfs_is_dir (g, remote); if (remote_is_dir == -1) return -1; if (!remote_is_dir) { fprintf (stderr, _("copy-in: target '%s' is not a directory\n"), remote); return -1; } > + if (split_path (buf, buf_len, localpath, &dirname, &basename) == -1) &...
2003 Oct 01
1
3.7.1p2 sftp recurse patch
...ath Symlink remote file\n"); @@ -430,6 +436,106 @@ } static int +do_recursive_download(struct sftp_conn *conn, char *remote_path, + char *local_path, int pflag) +{ + char *remote_tmp, *local_tmp; + int err, n; + SFTP_DIRENT **d; + extern int errno; + + if (recursion && remote_is_dir(conn, remote_path)) { + if (!is_dir(local_path)) { + /* Create local directory */ + err = mkdir(local_path, 0777); + if (err == -1) { + error("Couldn't create local directory \"%s\": " + "%s", local_path, strerror(errno)); + goto END; + } + } +...
2015 Sep 29
0
[PATCH 2/2] copy-in: error out early if the localpath does not exist (RHBZ#1267032)
...dir char buf[buf_len]; const char *dirname, *basename; CLEANUP_FREE char *tar_buf = NULL; + struct stat statbuf; + + if (stat (localpath, &statbuf) == -1) { + error (g, _("source '%s' does not exist (or cannot be read)"), localpath); + return -1; + } int remote_is_dir = guestfs_is_dir (g, remotedir); if (remote_is_dir == -1) -- 2.1.0
2015 Sep 29
0
Re: [PATCH 2/2] copy-in: error out early if the localpath does not exist (RHBZ#1267032)
...r *tar_buf = NULL; > > + struct stat statbuf; > > + > > + if (stat (localpath, &statbuf) == -1) { > > + error (g, _("source '%s' does not exist (or cannot be read)"), localpath); > > + return -1; > > + } > > > > int remote_is_dir = guestfs_is_dir (g, remotedir); > > if (remote_is_dir == -1) > > NACK. See the patch series I just posted. Would patch #2 be acceptable anyway, as simple starting check? -- Pino Toscano
2015 Feb 02
8
[PATCH 0/7 v2] Make copy_in & copy_out APIs, and use copy_in in customize
Hi, attached there is the second version of the patch series adding copy_in and copy_out in the library, mostly moving them from guestfish. It also adds the copy_in usage in virt-customize, as aid in a new image building. Thanks, Pino Toscano (7): cmd: add a way to run (and wait) asynchronously commands cmd: add a child-setup callback cmd: add the possibility to get a fd to the process
2015 Jan 26
6
[PATCH 1/6] cmd: add a way to run (and wait) asynchronously commands
--- src/command.c | 64 +++++++++++++++++++++++++++++++++++++++++++------- src/guestfs-internal.h | 3 +++ 2 files changed, 58 insertions(+), 9 deletions(-) diff --git a/src/command.c b/src/command.c index 4bb469b..e26573d 100644 --- a/src/command.c +++ b/src/command.c @@ -360,7 +360,7 @@ debug_command (struct command *cmd) } static int -run_command (struct command *cmd)
2007 Dec 12
0
Revisiting sftp tab completion patch
...do_realpath(conn, "."); - if (pwd == NULL) + remote_path = do_realpath(conn, "."); + if (remote_path == NULL) fatal("Need cwd"); if (file1 != NULL) { dir = xstrdup(file1); - dir = make_absolute(dir, pwd); + dir = make_absolute(dir, remote_path); if (remote_is_dir(conn, dir) && file2 == NULL) { printf("Changing to: %s\n", dir); snprintf(cmd, sizeof cmd, "cd \"%s\"", dir); - if (parse_dispatch_command(conn, cmd, &pwd, 1) != 0) { + if (parse_dispatch_command(conn, cmd, &remote_path, 1) != 0) { x...
2008 Jul 21
2
sftp needs a long time for sending a filelist
Hello all Im using sftp 1:4.7p1-8ubuntu1.2 in a batchjob Ive noticed that sftp needs a long time for sending a filelist. The timespan increases exponential if many files are on the remoteserver. for example "ls -la *.txt" needs 10 seconds for 2000 files but needs 50 seconds for 4000 files. For 150.000 Files i have to wait 15 minutes for example but the
2017 Apr 04
1
[PATCH] Use Unicode single quotes ‘’ in place of short single quoted strings throughout.
...== -1) { - error (g, _("source '%s' does not exist (or cannot be read)"), localpath); + error (g, _("source ‘%s’ does not exist (or cannot be read)"), localpath); return -1; } @@ -57,7 +57,7 @@ guestfs_impl_copy_in (guestfs_h *g, return -1; if (!remote_is_dir) { - error (g, _("target '%s' is not a directory"), remotedir); + error (g, _("target ‘%s’ is not a directory"), remotedir); return -1; } @@ -139,7 +139,7 @@ guestfs_impl_copy_out (guestfs_h *g, if (stat (localdir, &statbuf) == -1 || ! (S_...