What is the difference between NTFS Junction Points and Symbolic Links?

前端 未结 6 1236
名媛妹妹
名媛妹妹 2020-12-02 04:39

At a high level, the only obvious difference between NTFS Junction Points and Symbolic Links is that Junctions are only able to be directories, while SymLinks are allowed to

6条回答
  •  眼角桃花
    2020-12-02 05:17

    Link Shell Extension, http://schinagl.priv.at/nt/hardlinkshellext/hardlinkshellext.html, is a great tool for creating and viewing many kinds of links. It also has excellent documentation.

    [On a full install, it adds a new properties tab if you're looking at an advanced link. At also adds icon-overlay arrows for the various link types - scroll to the FAQ section if these do not show up; Windows only supports thirteen overlays; he shows a registry workaround. An example of its informational usefulness: Unsuccessfully trying to get privileges to what you thought was a folder, but in fact was a system-provided Junction Link, often used for compatibility purposes with older editions of Windows.]

    Junctions and Symbolic Links act essentially identically when created for a directory on a local system.

    However:

    They act differently over a network. This link describes this behavior: https://superuser.com/questions/343074/directory-junction-vs-directory-symbolic-link

    If you think of Junction Links as "shortcuts that fool the OS as to location" you'll have a good practical simile of their use and what breaks them. The main difference is that if you copy Symbolic Links or Junctions, it copies the target, rather (like shortcuts) merely the file that contains the pointer. As with shortcuts, you can delete Symbolic or Junction Links without removing the target files/folders. [Hard Links, the file is only deleted with the removal of the last link - including from the recycle bin. Look at the properties tag in LSE for any of these links to see the target or the reference count for Hard Links.]

    Hard Links or Shortcuts are the only link types that can be moved with no side-effects like breaking or copying the entire target. Moving the target always breaks the links, though they can easily be updated in the properties tab (shown with LSE) or re-created, if complicated, with LSE.

    The creation of Symbolic Links requires administrator privileges whereas Junctions do not. This plus the extensive, internal OS use of Junctions suggests that Windows handles them in an intuitive, expected manner. [Do be somewhat wary of unexpected side-effects from system folders (from experience with Win 10).]

    [Some of the backup-specific features of Link Shell Extension are extremely useful - in short, it can create several types of updatable symbolic link structures in standard folders for pending backup purposes.]

提交回复
热议问题