Re: Warn when duplicating remote symlinks?
This request has been added to the tracker
Issue 358 – Option to toggle mode of symlink duplication.
Issue 358 – Option to toggle mode of symlink duplication.
In that case WinSCP doescp -p -r -f
. What would you suggest instead?
cp -r
option:
By default,cp
follows symbolic links only when not copying recursively. This default can be overridden with the--archive
(-a
),-d
,--dereference
(-L
),--no-dereference
(-P
), and-H
options. If more than one of these options is specified, the last one silently overrides the others.
By default,cp
copies the contents of special files only when not copying recursively. This default can be overridden with the--copy-contents
option.
$ touch target.txt # make a file
$ ln -s target.txt symlink_to_target.txt # symlink to it
$ cp symlink_to_target.txt cp_of_symlink_to_target.txt # cp copies target
$ cp -r symlink_to_target.txt cp_r_of_symlink_to_target.txt # cp -r copies symlink
$ ls -l
-rw-r--r-- 1 ... 0 Jan 12 13:39 cp_of_symlink_to_target.txt
lrwxrwxrwx 1 ... 10 Jan 12 13:41 cp_r_of_symlink_to_target.txt -> target.txt
lrwxrwxrwx 1 ... 10 Jan 12 13:39 symlink_to_target.txt -> target.txt
-rw-r--r-- 1 ... 0 Jan 12 13:38 target.txt
-adLPH
options mentioned above, but I'm not familiar enough with them to know which one to use.
-r
option might be omitted if the selection being Duplicate'd does not contain any directories. However, I suspect this would be at least as confusing as the current implementation.)
cp -p -r -f
. What would you suggest instead?
What protocol?
What mode of duplication have you used? Direct or via local temporary copy?
cp
, which copies the contents of the symlink's target into a new file by default. It seems "Duplicate" works like cp --no-dereference
, just making another symlink. Thus, changes to the duplicate affect the original file. So now I have no backup and two symlinks to a broken revision 8-P
cp
.)