#include "io.h"
extern int verbose;
-extern int list_only;
extern int am_root;
extern int am_server;
extern int am_daemon;
/* Nothing yet */
}
-static void list_file_entry(struct file_struct *f)
-{
- char permbuf[PERMSTRING_SIZE];
- double len;
-
- if (!F_IS_ACTIVE(f)) {
- /* this can happen if duplicate names were removed */
- return;
- }
-
- permstring(permbuf, f->mode);
- len = F_LENGTH(f);
-
- /* TODO: indicate '+' if the entry has an ACL. */
-
-#ifdef SUPPORT_LINKS
- if (preserve_links && S_ISLNK(f->mode)) {
- rprintf(FINFO, "%s %11.0f %s %s -> %s\n",
- permbuf, len, timestring(f->modtime),
- f_name(f, NULL), F_SYMLINK(f));
- } else
-#endif
- {
- rprintf(FINFO, "%s %11.0f %s %s\n",
- permbuf, len, timestring(f->modtime),
- f_name(f, NULL));
- }
-}
-
/* Stat either a symlink or its referent, depending on the settings of
* copy_links, copy_unsafe_links, etc. Returns -1 on error, 0 on success.
*
if (verbose > 3)
output_flist(flist);
- if (list_only) {
- int i;
- for (i = flist->low; i <= flist->high; i++)
- list_file_entry(flist->files[i]);
- }
-
if (verbose > 2)
rprintf(FINFO, "recv_file_list done\n");
return j;
}
+static void list_file_entry(struct file_struct *f)
+{
+ char permbuf[PERMSTRING_SIZE];
+ double len;
+
+ if (!F_IS_ACTIVE(f)) {
+ /* this can happen if duplicate names were removed */
+ return;
+ }
+
+ permstring(permbuf, f->mode);
+ len = F_LENGTH(f);
+
+ /* TODO: indicate '+' if the entry has an ACL. */
+
+#ifdef SUPPORT_LINKS
+ if (preserve_links && S_ISLNK(f->mode)) {
+ rprintf(FINFO, "%s %11.0f %s %s -> %s\n",
+ permbuf, len, timestring(f->modtime),
+ f_name(f, NULL), F_SYMLINK(f));
+ } else
+#endif
+ {
+ rprintf(FINFO, "%s %11.0f %s %s\n",
+ permbuf, len, timestring(f->modtime),
+ f_name(f, NULL));
+ }
+}
+
static int phase = 0;
static int dflt_perms;
int implied_dirs_are_missing = relative_paths && !implied_dirs && !inc_recurse;
int del_opts = delete_mode || force_delete ? DEL_RECURSE : 0;
- if (list_only)
- return;
-
if (verbose > 2)
rprintf(FINFO, "recv_generator(%s,%d)\n", fname, ndx);
+ if (list_only) {
+ if (S_ISDIR(file->mode)
+ && ((!implied_dirs && !(file->flags & FLAG_XFER_DIR))
+ || (inc_recurse && ndx != cur_flist->ndx_start - 1)))
+ return;
+ list_file_entry(file);
+ return;
+ }
+
if (server_filter_list.head) {
if (excluded_below >= 0) {
if (F_DEPTH(file) > excluded_below