1 /* -*- c-file-style: "linux" -*-
3 rsync -- fast file replication program
5 Copyright (C) 1996-2000 by Andrew Tridgell
6 Copyright (C) Paul Mackerras 1996
7 Copyright (C) 2002 by Martin Pool <mbp@samba.org>
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28 extern int itemize_changes;
29 extern int relative_paths;
30 extern int keep_dirlinks;
31 extern int preserve_links;
33 extern int preserve_devices;
34 extern int preserve_hard_links;
35 extern int preserve_perms;
36 extern int preserve_uid;
37 extern int preserve_gid;
38 extern int preserve_times;
39 extern int omit_dir_times;
40 extern int delete_during;
41 extern int update_only;
42 extern int opt_ignore_existing;
44 extern int make_backups;
45 extern int csum_length;
46 extern int ignore_times;
48 extern OFF_T max_size;
49 extern int io_timeout;
50 extern int protocol_version;
51 extern int fuzzy_basis;
52 extern int always_checksum;
53 extern char *partial_dir;
54 extern char *basis_dir[];
55 extern int compare_dest;
57 extern int whole_file;
58 extern int local_server;
60 extern int read_batch;
61 extern int only_existing;
62 extern int orig_umask;
63 extern int safe_symlinks;
64 extern long block_size; /* "long" because popt can't set an int32. */
66 extern struct filter_list_struct server_filter_list;
68 static int unchanged_attrs(struct file_struct *file, STRUCT_STAT *st)
71 && (st->st_mode & CHMOD_BITS) != (file->mode & CHMOD_BITS))
74 if (am_root && preserve_uid && st->st_uid != file->uid)
77 if (preserve_gid && file->gid != GID_NONE && st->st_gid != file->gid)
84 #define SID_UPDATING ITEM_UPDATING
85 #define SID_REPORT_CHECKSUM ITEM_REPORT_CHECKSUM
86 #define SID_NO_DEST_AND_NO_UPDATE (1<<16)
88 static void itemize(struct file_struct *file, int statret, STRUCT_STAT *st,
89 int32 sflags, int f_out, int ndx)
91 int iflags = sflags & (SID_UPDATING | SID_REPORT_CHECKSUM);
94 if (S_ISREG(file->mode) && file->length != st->st_size)
95 iflags |= ITEM_REPORT_SIZE;
96 if (!(sflags & SID_NO_DEST_AND_NO_UPDATE)) {
97 int keep_time = !preserve_times ? 0
98 : S_ISDIR(file->mode) ? !omit_dir_times
99 : !S_ISLNK(file->mode);
101 if ((iflags & ITEM_UPDATING && !keep_time)
102 || (keep_time && file->modtime != st->st_mtime))
103 iflags |= ITEM_REPORT_TIME;
104 if (preserve_perms && file->mode != st->st_mode)
105 iflags |= ITEM_REPORT_PERMS;
106 if (preserve_uid && am_root && file->uid != st->st_uid)
107 iflags |= ITEM_REPORT_OWNER;
108 if (preserve_gid && file->gid != GID_NONE
109 && st->st_gid != file->gid)
110 iflags |= ITEM_REPORT_GROUP;
113 iflags |= ITEM_IS_NEW | ITEM_UPDATING;
115 if (iflags && !read_batch) {
117 write_int(f_out, ndx);
118 write_short(f_out, iflags);
123 /* Perform our quick-check heuristic for determining if a file is unchanged. */
124 static int unchanged_file(char *fn, struct file_struct *file, STRUCT_STAT *st)
126 if (st->st_size != file->length)
129 /* if always checksum is set then we use the checksum instead
130 of the file time to determine whether to sync */
131 if (always_checksum && S_ISREG(st->st_mode)) {
132 char sum[MD4_SUM_LENGTH];
133 file_checksum(fn, sum, st->st_size);
134 return memcmp(sum, file->u.sum, protocol_version < 21 ? 2
135 : MD4_SUM_LENGTH) == 0;
144 return cmp_modtime(st->st_mtime, file->modtime) == 0;
149 * set (initialize) the size entries in the per-file sum_struct
150 * calculating dynamic block and checksum sizes.
152 * This is only called from generate_and_send_sums() but is a separate
153 * function to encapsulate the logic.
155 * The block size is a rounded square root of file length.
157 * The checksum size is determined according to:
158 * blocksum_bits = BLOCKSUM_EXP + 2*log2(file_len) - log2(block_len)
159 * provided by Donovan Baarda which gives a probability of rsync
160 * algorithm corrupting data and falling back using the whole md4
163 * This might be made one of several selectable heuristics.
165 static void sum_sizes_sqroot(struct sum_struct *sum, int64 len)
171 blength = block_size;
172 else if (len <= BLOCK_SIZE * BLOCK_SIZE)
173 blength = BLOCK_SIZE;
178 for (c = 1, l = len, cnt = 0; l >>= 2; c <<= 1, cnt++) {}
179 if (cnt >= 31 || c >= MAX_BLOCK_SIZE)
180 blength = MAX_BLOCK_SIZE;
185 if (len < (int64)blength * blength)
188 } while (c >= 8); /* round to multiple of 8 */
189 blength = MAX(blength, BLOCK_SIZE);
193 if (protocol_version < 27) {
194 s2length = csum_length;
195 } else if (csum_length == SUM_LENGTH) {
196 s2length = SUM_LENGTH;
200 int b = BLOCKSUM_BIAS;
201 for (l = len; l >>= 1; b += 2) {}
202 for (c = blength; c >>= 1 && b; b--) {}
203 /* add a bit, subtract rollsum, round up. */
204 s2length = (b + 1 - 32 + 7) / 8; /* --optimize in compiler-- */
205 s2length = MAX(s2length, csum_length);
206 s2length = MIN(s2length, SUM_LENGTH);
210 sum->blength = blength;
211 sum->s2length = s2length;
212 sum->count = (len + (blength - 1)) / blength;
213 sum->remainder = (len % blength);
215 if (sum->count && verbose > 2) {
217 "count=%.0f rem=%ld blength=%ld s2length=%d flength=%.0f\n",
218 (double)sum->count, (long)sum->remainder, (long)sum->blength,
219 sum->s2length, (double)sum->flength);
225 * Generate and send a stream of signatures/checksums that describe a buffer
227 * Generate approximately one checksum every block_len bytes.
229 static void generate_and_send_sums(int fd, OFF_T len, int f_out, int f_copy)
232 struct map_struct *mapbuf;
233 struct sum_struct sum;
236 sum_sizes_sqroot(&sum, len);
239 mapbuf = map_file(fd, len, MAX_MAP_SIZE, sum.blength);
243 write_sum_head(f_out, &sum);
245 for (i = 0; i < sum.count; i++) {
246 int32 n1 = (int32)MIN(len, (OFF_T)sum.blength);
247 char *map = map_ptr(mapbuf, offset, n1);
248 uint32 sum1 = get_checksum1(map, n1);
249 char sum2[SUM_LENGTH];
252 full_write(f_copy, map, n1);
254 get_checksum2(map, n1, sum2);
258 "chunk[%.0f] offset=%.0f len=%ld sum1=%08lx\n",
259 (double)i, (double)offset, (long)n1,
260 (unsigned long)sum1);
262 write_int(f_out, sum1);
263 write_buf(f_out, sum2, sum.s2length);
273 /* Try to find a filename in the same dir as "fname" with a similar name. */
274 static int find_fuzzy(struct file_struct *file, struct file_list *dirlist)
276 int fname_len, fname_suf_len;
277 const char *fname_suf, *fname = file->basename;
278 uint32 lowest_dist = 0x7FFFFFFF;
279 int j, lowest_j = -1;
281 fname_len = strlen(fname);
282 fname_suf = find_filename_suffix(fname, fname_len, &fname_suf_len);
284 for (j = 0; j < dirlist->count; j++) {
285 struct file_struct *fp = dirlist->files[j];
286 const char *suf, *name;
290 if (!S_ISREG(fp->mode) || !fp->length
291 || fp->flags & FLAG_NO_FUZZY)
296 if (fp->length == file->length
297 && fp->modtime == file->modtime) {
300 "fuzzy size/modtime match for %s\n",
307 suf = find_filename_suffix(name, len, &suf_len);
309 dist = fuzzy_distance(name, len, fname, fname_len);
310 /* Add some extra weight to how well the suffixes match. */
311 dist += fuzzy_distance(suf, suf_len, fname_suf, fname_suf_len)
314 rprintf(FINFO, "fuzzy distance for %s = %d.%05d\n",
315 name, (int)(dist>>16), (int)(dist&0xFFFF));
317 if (dist <= lowest_dist) {
327 /* Acts on flist->file's ndx'th item, whose name is fname. If a directory,
328 * make sure it exists, and has the right permissions/timestamp info. For
329 * all other non-regular files (symlinks, etc.) we create them here. For
330 * regular files that have changed, we try to find a basis file and then
331 * start sending checksums.
333 * Note that f_out is set to -1 when doing final directory-permission and
334 * modification-time repair. */
335 static void recv_generator(char *fname, struct file_list *flist,
336 struct file_struct *file, int ndx,
337 int f_out, int f_out_name)
339 static int missing_below = -1;
340 static char *fuzzy_dirname = NULL;
341 static struct file_list *fuzzy_dirlist = NULL;
342 struct file_struct *fuzzy_file = NULL;
343 int fd = -1, f_copy = -1;
344 STRUCT_STAT st, partial_st;
345 struct file_struct *back_file = NULL;
346 int statret, stat_errno;
347 char *fnamecmp, *partialptr, *backupptr = NULL;
348 char fnamecmpbuf[MAXPATHLEN];
350 int maybe_DEL_TERSE = itemize_changes ? 0 : DEL_TERSE;
357 flist_free(fuzzy_dirlist);
358 fuzzy_dirlist = NULL;
359 fuzzy_dirname = NULL;
361 if (missing_below >= 0) {
369 rprintf(FINFO, "recv_generator(%s,%d)\n",
370 safe_fname(fname), ndx);
373 if (server_filter_list.head
374 && check_filter(&server_filter_list, fname,
375 S_ISDIR(file->mode)) < 0) {
377 rprintf(FINFO, "skipping server-excluded file \"%s\"\n",
383 if (missing_below >= 0 && file->dir.depth <= missing_below) {
391 if (fuzzy_basis && S_ISREG(file->mode)) {
392 char *dn = file->dirname ? file->dirname : ".";
393 /* Yes, identical dirnames are guaranteed to have
394 * identical pointers at this point. */
395 if (fuzzy_dirname != dn) {
397 flist_free(fuzzy_dirlist);
399 fuzzy_dirlist = get_dirlist(fuzzy_dirname, 1);
403 statret = link_stat(fname, &st,
404 keep_dirlinks && S_ISDIR(file->mode));
408 if (only_existing && statret == -1 && stat_errno == ENOENT) {
409 /* we only want to update existing files */
411 rprintf(FINFO, "not creating new file \"%s\"\n",
417 if (statret == 0 && !preserve_perms
418 && S_ISDIR(st.st_mode) == S_ISDIR(file->mode)) {
419 /* if the file exists already and we aren't perserving
420 * permissions then act as though the remote end sent
421 * us the file permissions we already have */
422 file->mode = (file->mode & ~CHMOD_BITS)
423 | (st.st_mode & CHMOD_BITS);
426 if (S_ISDIR(file->mode)) {
427 /* The file to be received is a directory, so we need
428 * to prepare appropriately. If there is already a
429 * file of that name and it is *not* a directory, then
430 * we need to delete it. If it doesn't exist, then
431 * (perhaps recursively) create it. */
432 if (statret == 0 && !S_ISDIR(st.st_mode)) {
433 delete_file(fname, maybe_DEL_TERSE);
436 if (dry_run && statret != 0 && missing_below < 0) {
437 missing_below = file->dir.depth;
440 if (protocol_version >= 29 && f_out != -1)
441 itemize(file, statret, &st, 0, f_out, ndx);
442 if (statret != 0 && do_mkdir(fname,file->mode) != 0 && errno != EEXIST) {
443 if (!relative_paths || errno != ENOENT
444 || create_directory_path(fname, orig_umask) < 0
445 || do_mkdir(fname, file->mode) < 0) {
446 rsyserr(FERROR, errno,
447 "recv_generator: mkdir %s failed",
451 if (set_perms(fname, file, statret ? NULL : &st, 0)
452 && verbose && protocol_version < 29 && f_out != -1)
453 rprintf(FINFO, "%s/\n", safe_fname(fname));
454 if (delete_during && f_out != -1 && csum_length != SUM_LENGTH
455 && (file->flags & FLAG_DEL_HERE))
456 delete_in_dir(flist, fname, file);
460 if (max_size && file->length > max_size) {
462 rprintf(FINFO, "%s is over max-size\n",
468 if (preserve_links && S_ISLNK(file->mode)) {
470 if (safe_symlinks && unsafe_symlink(file->u.link, fname)) {
473 "ignoring unsafe symlink %s -> \"%s\"\n",
475 safe_fname(file->u.link));
480 int dflag = S_ISDIR(st.st_mode) ? DEL_DIR : 0;
481 char lnk[MAXPATHLEN];
485 && (len = readlink(fname, lnk, MAXPATHLEN-1)) > 0) {
487 /* A link already pointing to the
488 * right place -- no further action
490 if (strcmp(lnk, file->u.link) == 0) {
491 if (protocol_version >= 29) {
492 itemize(file, 0, &st, 0,
495 set_perms(fname, file, &st,
500 /* Not the right symlink (or not a symlink), so
502 if (S_ISLNK(st.st_mode))
503 delete_file(fname, dflag | DEL_TERSE);
505 delete_file(fname, dflag | maybe_DEL_TERSE);
509 if (do_symlink(file->u.link,fname) != 0) {
510 rsyserr(FERROR, errno, "symlink %s -> \"%s\" failed",
511 full_fname(fname), safe_fname(file->u.link));
513 set_perms(fname,file,NULL,0);
514 if (protocol_version >= 29) {
515 itemize(file, statret, &st, SID_UPDATING,
517 } else if (verbose) {
518 rprintf(FINFO, "%s -> %s\n", safe_fname(fname),
519 safe_fname(file->u.link));
526 if (am_root && preserve_devices && IS_DEVICE(file->mode)) {
528 st.st_mode != file->mode ||
529 st.st_rdev != file->u.rdev) {
530 int dflag = S_ISDIR(st.st_mode) ? DEL_DIR : 0;
531 if (IS_DEVICE(st.st_mode))
532 delete_file(fname, dflag | DEL_TERSE);
534 delete_file(fname, dflag | maybe_DEL_TERSE);
538 rprintf(FINFO,"mknod(%s,0%o,0x%x)\n",
540 (int)file->mode, (int)file->u.rdev);
542 if (do_mknod(fname,file->mode,file->u.rdev) != 0) {
543 rsyserr(FERROR, errno, "mknod %s failed",
546 set_perms(fname,file,NULL,0);
547 if (protocol_version >= 29) {
548 itemize(file, statret, &st, SID_UPDATING,
550 } else if (verbose) {
551 rprintf(FINFO, "%s\n",
556 if (protocol_version >= 29) {
557 itemize(file, statret, &st, 0,
560 set_perms(fname, file, &st, PERMS_REPORT);
565 if (preserve_hard_links && hard_link_check(file, HL_CHECK_MASTER))
568 if (!S_ISREG(file->mode)) {
569 rprintf(FINFO, "skipping non-regular file \"%s\"\n",
575 fnamecmp_type = FNAMECMP_FNAME;
577 if (statret != 0 && basis_dir[0] != NULL) {
578 int fallback_match = -1;
582 pathjoin(fnamecmpbuf, sizeof fnamecmpbuf,
583 basis_dir[i], fname);
584 if (link_stat(fnamecmpbuf, &st, 0) == 0
585 && S_ISREG(st.st_mode)) {
591 } else if (match_level == 2
592 && !unchanged_attrs(file, &st))
594 if (!unchanged_file(fnamecmpbuf, file, &st))
598 if (!unchanged_attrs(file, &st))
604 } while (basis_dir[++i] != NULL);
606 if (match_level < 3) {
608 pathjoin(fnamecmpbuf, sizeof fnamecmpbuf,
609 basis_dir[i], fname);
612 if (link_dest && match_level == 3 && !dry_run) {
613 if (do_link(fnamecmpbuf, fname) < 0) {
615 rsyserr(FINFO, errno,
617 full_fname(fnamecmpbuf),
620 fnamecmp = fnamecmpbuf;
626 fnamecmp = fnamecmpbuf;
632 if (statret == 0 && !S_ISREG(st.st_mode)) {
633 int dflag = S_ISDIR(st.st_mode) ? DEL_DIR : 0;
634 if (delete_file(fname, dflag | maybe_DEL_TERSE) != 0)
640 if (partial_dir && (partialptr = partial_dir_fname(fname)) != NULL
641 && link_stat(partialptr, &partial_st, 0) == 0
642 && S_ISREG(partial_st.st_mode)) {
644 goto prepare_to_open;
648 if (statret != 0 && fuzzy_basis && dry_run <= 1) {
649 int j = find_fuzzy(file, fuzzy_dirlist);
651 fuzzy_file = fuzzy_dirlist->files[j];
652 f_name_to(fuzzy_file, fnamecmpbuf);
654 rprintf(FINFO, "fuzzy basis selected for %s: %s\n",
655 safe_fname(fname), safe_fname(fnamecmpbuf));
657 st.st_mode = fuzzy_file->mode;
658 st.st_size = fuzzy_file->length;
659 st.st_mtime = fuzzy_file->modtime;
661 fnamecmp = fnamecmpbuf;
662 fnamecmp_type = FNAMECMP_FUZZY;
667 if (preserve_hard_links && hard_link_check(file, HL_SKIP))
669 if (stat_errno == ENOENT)
672 rsyserr(FERROR, stat_errno,
673 "recv_generator: failed to stat %s",
679 if (opt_ignore_existing && fnamecmp_type == FNAMECMP_FNAME) {
681 rprintf(FINFO, "%s exists\n", safe_fname(fname));
685 if (update_only && fnamecmp_type == FNAMECMP_FNAME
686 && cmp_modtime(st.st_mtime, file->modtime) > 0) {
688 rprintf(FINFO, "%s is newer\n", safe_fname(fname));
692 if (!compare_dest && fnamecmp_type <= FNAMECMP_BASIS_DIR_HIGH)
694 else if (fnamecmp_type == FNAMECMP_FUZZY)
696 else if (unchanged_file(fnamecmp, file, &st)) {
697 if (protocol_version >= 29) {
698 itemize(file, statret, &st,
699 fnamecmp_type == FNAMECMP_FNAME
700 ? 0 : SID_NO_DEST_AND_NO_UPDATE,
703 if (fnamecmp_type == FNAMECMP_FNAME)
704 set_perms(fname, file, &st, PERMS_REPORT);
711 fnamecmp = partialptr;
712 fnamecmp_type = FNAMECMP_PARTIAL_DIR;
716 if (dry_run || read_batch)
718 if (whole_file > 0) {
725 int j = flist_find(fuzzy_dirlist, file);
726 if (j >= 0) /* don't use changing file as future fuzzy basis */
727 fuzzy_dirlist->files[j]->flags |= FLAG_NO_FUZZY;
731 fd = do_open(fnamecmp, O_RDONLY, 0);
734 rsyserr(FERROR, errno, "failed to open %s, continuing",
735 full_fname(fnamecmp));
737 /* pretend the file didn't exist */
738 if (preserve_hard_links && hard_link_check(file, HL_SKIP))
744 if (inplace && make_backups) {
745 if (!(backupptr = get_backup_name(fname))) {
749 if (!(back_file = make_file(fname, NULL, NO_FILTERS))) {
751 goto pretend_missing;
753 if (robust_unlink(backupptr) && errno != ENOENT) {
754 rsyserr(FERROR, errno, "unlink %s",
755 full_fname(backupptr));
760 if ((f_copy = do_open(backupptr,
761 O_WRONLY | O_CREAT | O_TRUNC | O_EXCL, 0600)) < 0) {
762 rsyserr(FERROR, errno, "open %s",
763 full_fname(backupptr));
768 fnamecmp_type = FNAMECMP_BACKUP;
772 rprintf(FINFO, "gen mapped %s of size %.0f\n",
773 safe_fname(fnamecmp), (double)st.st_size);
777 rprintf(FINFO, "generating and sending sums for %d\n", ndx);
780 write_int(f_out, ndx);
781 if (protocol_version >= 29) {
782 itemize(file, statret, &st, SID_UPDATING
783 | (always_checksum ? SID_REPORT_CHECKSUM : 0),
785 if (inplace && !read_batch)
786 write_byte(f_out, fnamecmp_type);
788 if (f_out_name >= 0) {
789 write_byte(f_out_name, fnamecmp_type);
790 if (fnamecmp_type == FNAMECMP_FUZZY) {
791 uchar lenbuf[3], *lb = lenbuf;
792 int len = strlen(fuzzy_file->basename);
794 #if MAXPATHLEN > 0x7FFF
795 *lb++ = len / 0x10000 + 0x80;
798 *lb++ = len / 0x100 + 0x80;
802 write_buf(f_out_name, lenbuf, lb - lenbuf + 1);
803 write_buf(f_out_name, fuzzy_file->basename, len);
807 if (dry_run || read_batch)
811 generate_and_send_sums(fd, st.st_size, f_out, f_copy);
815 set_perms(backupptr, back_file, NULL, 0);
817 rprintf(FINFO, "backed up %s to %s\n",
818 safe_fname(fname), safe_fname(backupptr));
825 write_sum_head(f_out, NULL);
829 void generate_files(int f_out, struct file_list *flist, char *local_name,
834 char fbuf[MAXPATHLEN];
835 int need_retouch_dir_times = preserve_times && !omit_dir_times;
836 int need_retouch_dir_perms = 0;
837 int save_only_existing = only_existing;
838 int save_opt_ignore_existing = opt_ignore_existing;
841 rprintf(FINFO, "generator starting pid=%ld count=%d\n",
842 (long)getpid(), flist->count);
848 ? "delta-transmission disabled for local transfer or --whole-file\n"
849 : "delta transmission enabled\n");
852 /* We expect to just sit around now, so don't exit on a timeout.
853 * If we really get a timeout then the other process should exit. */
856 for (i = 0; i < flist->count; i++) {
857 struct file_struct *file = flist->files[i];
858 struct file_struct copy;
863 /* We need to ensure that any dirs we create have writeable
864 * permissions during the time we are putting files within
865 * them. This is then fixed after the transfer is done. */
866 if (!am_root && S_ISDIR(file->mode) && !(file->mode & S_IWUSR)) {
868 copy.mode |= S_IWUSR; /* user write */
870 need_retouch_dir_perms = 1;
873 recv_generator(local_name ? local_name : f_name_to(file, fbuf),
874 flist, file, i, f_out, f_out_name);
876 recv_generator(NULL, NULL, NULL, 0, -1, -1);
878 delete_in_dir(NULL, NULL, NULL);
881 csum_length = SUM_LENGTH;
882 only_existing = max_size = opt_ignore_existing = 0;
883 update_only = always_checksum = size_only = 0;
887 rprintf(FINFO,"generate_files phase=%d\n",phase);
889 write_int(f_out, -1);
891 /* files can cycle through the system more than once
892 * to catch initial checksum errors */
893 while ((i = get_redo_num()) != -1) {
894 struct file_struct *file = flist->files[i];
895 recv_generator(local_name ? local_name : f_name_to(file, fbuf),
896 flist, file, i, f_out, f_out_name);
900 only_existing = save_only_existing;
901 opt_ignore_existing = save_opt_ignore_existing;
904 rprintf(FINFO,"generate_files phase=%d\n",phase);
906 write_int(f_out, -1);
908 /* Read post-redo-phase MSG_DONE and any prior messages. */
911 if (preserve_hard_links)
914 if ((need_retouch_dir_perms || need_retouch_dir_times)
915 && !list_only && !local_name && !dry_run) {
916 /* Now we need to fix any directory permissions that were
917 * modified during the transfer and/or re-set any tweaked
918 * modified-time values. */
919 for (i = 0; i < flist->count; i++) {
920 struct file_struct *file = flist->files[i];
921 if (!file->basename || !S_ISDIR(file->mode))
923 if (!need_retouch_dir_times && file->mode & S_IWUSR)
925 recv_generator(local_name ? local_name : f_name(file),
926 flist, file, i, -1, -1);
929 recv_generator(NULL, NULL, NULL, 0, -1, -1);
932 rprintf(FINFO,"generate_files finished\n");