mpifileutils
mpifileutils copied to clipboard
dcp and dsync: handle when destination link exists with different target
Example: If we have these links:
link1 -> file1
link2 -> file2
And run dsync like this:
dsync link1 dst
dsync link2 dst
Then we get:
dst -> file1
But dst -> file2 would be expected.
Similarly, this happens when copying directories that contain links.
This happens with both dcp and dsync.
It doesn't seem there is a system call to update a link target. It seems the only way to update the target is to delete the destination before creating the symlink.
That's what cp seems to do:
strace cp --no-dereference some_link existing_link
...
stat("existing_link"...
lstat("some_link"...
lstat("existing_link"...
unlink("existing_link"...
...
symlink(... "existing_link"...
Hello,
Just updating the issue to say that I've been hit by this behavior. It would be nice to have it corrected of course ;)
In the meantime as a workaround, I'm using dfind --type l followed by drm before running dsync again.