From 752eaba41f34ce65c87418608efb591b5627ee65 Mon Sep 17 00:00:00 2001 From: David Dykstra Date: Wed, 24 Mar 1999 19:28:03 +0000 Subject: [PATCH] Backed out the change to create missing parent directories when using --compare-dest. It was due to an incomplete analysis of the problem, sorry. I left a comment in its place indicating that normally the parent directories should already have been created. It turned out to actually be a bug in nsbd in which it was not always including all the parent directories in the include list like it was supposed to. The files themselves were still being sent but that was only because my exclude_the_rest optimization was kicking in; if it weren't, excluding the parent directories would have had the side effect of excluding the files too. So it really had nothing to do with the --compare-dest option after all, just with the requirement that if you use --exclude '*' you need to explicitly include all parent directories of files you include. --- receiver.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/receiver.c b/receiver.c index 816d69fd..2b8869d1 100644 --- a/receiver.c +++ b/receiver.c @@ -417,8 +417,10 @@ int recv_files(int f_in,struct file_list *flist,char *local_name,int f_gen) fd2 = do_open(fnametmp,O_WRONLY|O_CREAT|O_EXCL, file->mode & INITACCESSPERMS); - if (fd2 == -1 && errno == ENOENT && - (relative_paths || (compare_dest != NULL)) && + /* in most cases parent directories will already exist + because their information should have been previously + transferred, but that may not be the case with -R */ + if (fd2 == -1 && relative_paths && errno == ENOENT && create_directory_path(fnametmp) == 0) { fd2 = do_open(fnametmp,O_WRONLY|O_CREAT|O_EXCL, file->mode & INITACCESSPERMS); -- 2.34.1