Can't copy symbolic link if file of same name exists

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nikolaus
    Expert
    • Apr 2013
    • 71

    Can't copy symbolic link if file of same name exists

    Steps to reproduce:
    mkdir a
    mkdir b
    touch b/foo
    ln -s . a/foo
    bcomp a b

    Click on the symbolic link "foo ( -> . )", and click "Copy right" in the toolbar. Beyond Compare will "fail to copy 1 items" because the file exists.

    If a/foo is a normal file instead of a symbolic link, the copy works as expected.
  • Aaron
    Team Scooter
    • Oct 2007
    • 16002

    #2
    Hello,

    In this scenario, it looks like you are copying an item into a directory that contains an item of an identical name. This would happen with folders, files, or symlinks. If you use Finder to perform the copy, it renames the destination item. BC4 does not currently support renaming the item on copy, since the name is used for the alignment.
    Aaron P Scooter Software

    Comment

    • nikolaus
      Expert
      • Apr 2013
      • 71

      #3
      I'm not trying to rename anything; I'm just trying to overwrite b/foo with a/foo. If a/foo and b/foo are both ordinary files, I can copy normally using BC4. If a/foo is a symbolic link, however, then the copy fails. Is that expected behaviour?

      Comment

      • nikolaus
        Expert
        • Apr 2013
        • 71

        #4
        Maybe the real issue is that a symbolic link named "foo" doesn't align with a normal file named "foo". I also can't manually align them.

        Comment

        • nikolaus
          Expert
          • Apr 2013
          • 71

          #5
          If they're both symbolic links, then they correctly align in the folder diff, but I still can't overwrite one with the other.

          Comment

          • Zoë
            Team Scooter
            • Oct 2007
            • 2666

            #6
            Right. Symbolic links are treated as a separate type, so they don't align with either files or folders, and you can't overwrite one of those with a symlink just like you can't overwrite a file with a folder (contrary to what Finder does).

            Are you trying to copy the symlink as a symlink, or copy the file contents? If the latter, you can turn on "Follow Symbolic Links" in the Session Settings dialog, on the Handling tab.
            Zoë P Scooter Software

            Comment

            • nikolaus
              Expert
              • Apr 2013
              • 71

              #7
              Originally posted by Craig
              Right. Symbolic links are treated as a separate type, so they don't align with either files or folders, and you can't overwrite one of those with a symlink just like you can't overwrite a file with a folder (contrary to what Finder does).
              Oh, ok, gotcha! I didn't realize that. Thanks!

              I was just trying to copy the symlink over. Also, it looks like if they're both symlinks then I still can't overwrite—I have to delete the target and then copy.

              Comment

              Working...