0

According to https://ss64.com/nt/mklink.html, junctions cannot link to files. Also, when I try this nevertheless with mklink /j junction-file target\foo.txt, the command will succeed, but the junction will be broken. However, the Robocopy docs mention:

/xjf Excludes junction points for files.

What are they referring to?

Marco Eckstein
  • 413
  • 1
  • 3
  • 14
  • @Mokubai: Didn't mean to one-click reopen, but nevertheless, the question already seems to cover what junctions are in general -- the difference is that Robocopy explicitly refers to junctions _to files_, all those questions only talk about junctions to directories. – u1686_grawity Apr 15 '21 at 14:54
  • Yeah, was just rereading the question and the while the dupes answered the title the actual body of the question is asking something wildly different. The title could do with fixing to be honest. – Mokubai Apr 15 '21 at 14:56
  • Edited the titlle – Marco Eckstein Apr 15 '21 at 14:58
  • For reference answering your title results in the following duplicates: https://superuser.com/questions/829461/what-are-the-other-uses-of-hard-links-junction-points-and-symbolic-links, https://superuser.com/questions/181672/what-is-the-difference-between-a-symlink-junction-hard-link-and-so-on, https://superuser.com/questions/67870/what-is-the-difference-between-ntfs-hard-links-and-directory-junctions – Mokubai Apr 15 '21 at 14:58
  • 1
    In theory though a junction should be the same for a file or a directory, it is just another reference to a filesystem object, the difference seems to be that robocopy has an actual option to ignore them *for files* (so that data is not copied, and robocopy cannot create junctions remotely without admin and filesystem access on the other machine) while you would still want to traverse directories as they may well contain both junctioned and "normal" files. Kinda conjecture so only a comment. – Mokubai Apr 15 '21 at 15:06

1 Answers1

0

The answer is that the options /xj, /xjd and /xjf are poorly named and documented. It is suggested that they apply to junctions (only). However, they apply to junctions and symbolic links. More precisely, /xjf only applies to symbolic links because junctions do not support files. See my related question and answer.

I have reported this issue.

Marco Eckstein
  • 413
  • 1
  • 3
  • 14