no such file or directory - but hey, the files are there!

Matt McCutchen hashproduct+rsync at
Mon Dec 25 22:33:14 GMT 2006

On 12/25/06, Tomasz Chmielewski <mangoo at> wrote:
> Wayne Davison wrote:
> > [...] The uDrive module looks to have a
> > bad path setting:  you can't use drive letters with rsync, so be sure to
> > specify something like "/cygdrive/u" instead of "u:".
> [...]
> rsync: pop_dir "/cygdrive/c/WINDOWS/system32/u:" (in uDrive) failed: No
> such file or directory (2)
> rsync error: errors selecting input/output files, dirs (code 3) at
> flist.c(1281) [sender=2.6.9]
> [...]
> [uDrive]
>         path = u:

I see what is going on here.  In order to scan under a source argument
for files to add to the file list, the sender needs to be in the
directory that maps to the root of the transfer.  In the first
command, the root of the transfer is the module, and the sender is
already there.  But in the second, the root of the transfer is the
"backup" subdirectory, so the sender needs to push_dir into "backup",
scan, and pop_dir back to the module.

As the sender is starting up, it pushes into "u:" by calling
chdir("u:").  Cygwin understands "u:" as an absolute path for the U
drive, so this works fine.  But the sender assumes "u:" is relative
because it doesn't begin with a slash, so the sender thinks it has
entered "/cygdrive/c/WINDOWS/system32/u:".  When the sender tries to
pop back into this directory later, the error occurs.

We have two options: document that rsync's behavior is undefined when
given a path with a drive letter, or teach push_dir to handle such
paths correctly on Cygwin.  I vote for the latter.


More information about the rsync mailing list