none
Junction Link vs Symbolic Link

    Question

  • W7x64:  If my goal is to move the contents of C:\ProgramData\myFolder  to D:\ProgramData\myFolder  (or any other folder on the same computer; NOT on a network), and not have to make changes in programs that are accessing C:\ProgramData\myFolder, are there any differences between a Junction link and a Symbolic link of which I need to be aware?
     
    Thank you.
     

    Ron
    lundi 12 mars 2012 12:12

Réponses

  • Hi,

    Storage objects a junction references are separate directories. Symbolic links can either be absolute or relative links.

    Based on your need, there is no limitation does Junction has.

    For more detailed information about the difference between Hard Link, Junction and Symbolic Link, please refer to Hard Links and Junctions and Creating Symbolic Links.


    Hope this helps.





    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    • Marqué comme réponse Ron Rosenfeld mercredi 14 mars 2012 10:58
    mercredi 14 mars 2012 10:23
    Modérateur

Toutes les réponses

  • Hello, I have used Symbolic links successfully in the past to do exactly as you described. I never saw a point to using junctions as they only have limitations so even when creating links locally on my PC I would still use mklink /d instead of /j.

    Make sure that when you copy files across different partitions that you will break the ACL (permissions) on the file&folder structure. If you want to keep that in tact you should use something like robocopy to transfer the files.

    The article about mklink actually shows you the exact command line option you should use for your situation:

    http://technet.microsoft.com/en-us/library/cc753194(v=ws.10).aspx 

    mklink /d C:\MyDocs D:\Users\User1\Documents

    lundi 12 mars 2012 13:14
  • On Mon, 12 Mar 2012 13:14:03 +0000, Jaap Brasser wrote:
     
    >
    >
    >Hello, I have used Symbolic links successfully in the past to do exactly as you described. I never saw a point to using junctions as they only have limitations so even when creating links locally on my PC I would still use mklink /d instead of /j.
    >
    >Make sure that when you copy files across different partitions that you will break the ACL (permissions) on the file&folder structure. If you want to keep that in tact you should use something like robocopy to transfer the files.
    >
    >The article about mklink actually shows you the exact command line option you should use for your situation:
    >
    >http://technet.microsoft.com/en-us/library/cc753194(v=ws.10).aspx  mklink /d C:\MyDocs D:\Users\User1\Documents
    >
    >
     
    Thank you for that information.  I have used both, and I note that most of the "built-in" W7 links are Junction Links.
     
    In the spirit of trying to understand things better, what limitations do Junction links have that would apply in the situation I have described?
     

    Ron
    lundi 12 mars 2012 13:45
  • Hi,

    Storage objects a junction references are separate directories. Symbolic links can either be absolute or relative links.

    Based on your need, there is no limitation does Junction has.

    For more detailed information about the difference between Hard Link, Junction and Symbolic Link, please refer to Hard Links and Junctions and Creating Symbolic Links.


    Hope this helps.





    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    • Marqué comme réponse Ron Rosenfeld mercredi 14 mars 2012 10:58
    mercredi 14 mars 2012 10:23
    Modérateur
  • Yes, it does help.  Thank you

    Ron

    mercredi 14 mars 2012 10:58
  • Symbolic links only work in vista/win7.  Junctions work in older versions of windows.

    mercredi 14 mars 2012 14:38
  • For a better understanding of the low-level differences have a look at this article:

    http://comptb.cects.com/2268-overview-to-understanding-hard-links-junction-points-and-symbolic-links-in-windows 

    Junction Point (Directory Hard Link):

    • A file that acts like a representation of a target directory, partition or volume on the same system
    • Has the same size as the target without duplicating it (doesn’t use any space)
    • Interpreted at the operating system level – transparent to SW programs and users
    • Deleting the junction point does not remove the target*
    • If the target is deleted, its content is still available through the junction point
    • Changing the junction point contents changes the target’s contents
    • Can reside on partitions or volumes separate from the target on the same system
    • Compatible with Win2k and above in Windows

    Symbolic link (Soft Link):

    • A file containing text interpreted by the operating system as a path to a file or directory
    • Has a file size of zero
    • Interpreted at the operating system level – transparent to SW programs and users
    • Deleting the Symbolic link does not remove the target
    • If the target is moved, renamed or deleted, the link points to a non-existing file or directory
    • Points to, rather than represents, the target using relative paths
    • Can reside on partitions or volumes separate from the target or on remote SMB network paths
    • Compatible with UNIX and UNIX-like systems and with Vista and above in Windows

    mercredi 14 mars 2012 14:55
  • Thank you for that information

    Ron

    mercredi 14 mars 2012 16:21
  • ...

    Junction Point (Directory Hard Link):

    • A file that acts like a representation of a target directory, partition or volume on the same system
    • Has the same size as the target without duplicating it (doesn’t use any space)
    • Interpreted at the operating system level – transparent to SW programs and users
    • Deleting the junction point does not remove the target*
    • If the target is deleted, its content is still available through the junction point
    • Changing the junction point contents changes the target’s contents
    • Can reside on partitions or volumes separate from the target on the same system
    • Compatible with Win2k and above in Windows

    Symbolic link (Soft Link):

    • A file containing text interpreted by the operating system as a path to a file or directory
    • Has a file size of zero
    • Interpreted at the operating system level – transparent to SW programs and users
    • Deleting the Symbolic link does not remove the target
    • If the target is moved, renamed or deleted, the link points to a non-existing file or directory
    • Points to, rather than represents, the target using relative paths
    • Can reside on partitions or volumes separate from the target or on remote SMB network paths
    • Compatible with UNIX and UNIX-like systems and with Vista and above in Windows

    I don't think that's right.

    When I create a junction it never behaves as a directory hard link and it is possible to delete the target directory and be left with a junction that points to a non existent directory.

    I've never found anything in Windows that behaves like a hard link to  a directory.



    Brian G. [in the UK]

    mercredi 5 février 2014 00:41
  • I'm so confused on these things, just started messing with it because it sounded like it would do what I wanted... All I want to do is create a folder on one volume that can display the contents of many folders I select across local volumes and refresh with the changing of those contents, much like the libraries work, though I want it to be its own directory that can be accessed in something like kodi. I can do this by selecting the contents of these directories manually and creating symbolic links in the one directory I want them to appear in, but then I have to manually do this with each change. Why can't I seem to just create some sort of portal to directories that will display all of their contents in one directory rather than links to each directory?
    samedi 7 février 2015 18:34
  • Why not just create a new library?

    Ron

    samedi 7 février 2015 20:37
  • right, i'd be happy to do that but i don't think it will act as a directory that fools software like kodi into thinking that's where the files actually reside...
    dimanche 8 février 2015 02:00
  • I'm so confused on these things, just started messing with it because it sounded like it would do what I wanted... All I want to do is create a folder on one volume that can display the contents of many folders I select across local volumes and refresh with the changing of those contents, much like the libraries work, though I want it to be its own directory that can be accessed in something like kodi. I can do this by selecting the contents of these directories manually and creating symbolic links in the one directory I want them to appear in, but then I have to manually do this with each change. Why can't I seem to just create some sort of portal to directories that will display all of their contents in one directory rather than links to each directory?

    When you say "refresh with the changing of those contents" do you mean new files may appear, the contents of the files may change, or what?

    Would it be okay if you had to run a batch file or something to do this refresh when required or does it need to just be refreshed automagically as changes happen?

    Can kodi look in sub directories?


    Brian G. [in the UK]


    • Modifié bdg2 dimanche 8 février 2015 02:55
    dimanche 8 février 2015 02:49
  • generally just new files appearing and/or files leaving/moving. If it's the only way, a batch file would certainly be easier than adding/removing symbolic links myself. I mean, I could just add all the folders to kodi's library... just thought it might be more convenient to add one and also be able to browse the files however I wanted in windows, but it's sounding less convenient now. I like to organize movies into many subfolders of genre, resolution, directors sometimes, but it would be cool to be able to browse them in windows by any number of different of these criteria. I don't know what I want at all, maybe I'll try and see what I can do with windows library functions and kodi's library separately.
    dimanche 8 février 2015 04:02
  • I guess I'd just like to be able to make virtual folders, that pretty much work like libraries, displaying/monitoring the contents of whichever folders you choose. I swear MS talked about virtual folders being a feature way back when vista was on the horizon... maybe they were just talking about those libraries or that's what they turned into...
    dimanche 8 février 2015 04:10
  • Examining some of the symbolic links I have created:  I have a folder on my C drive set up as a symbolic link to a different folder on my D drive.

    If a add a subfolder; and/or files to the target on my D drive, the change is immediately reflected in the link folder on my C drive.

    Is it that you do not want the folder structure of the target to show up in the symbolic link?   Just the files that are in subfolders?


    Ron

    dimanche 8 février 2015 08:57
  • I guess my biggest problem is just file management and organization, so to that end I'm starting to look into the myriad of alternative file browsers/managers out there. But as far as what I'm talking about for symbolic links, I'll post a pic or something that more clearly explains what I'm talking about...seems like something simple, yet still out of reach. I know the contents of a target do update, but yeah I'll just draw something up that will get this across much more easily...
    dimanche 8 février 2015 17:51
  • OK so here's what I'm trying for... apparently I can't post links or pics until verified. How do I get verified?

    I created some mock folders to try to get this across. The first image is what I want. The second is what I'm able to do.

    In this example you can see that the "all movies" folder displays the contents of 3 different folders. The only way I can do this is by creating links for movies 1-6 in "all movies", which isn't too difficult, but if I add a movie 7 to any of these folders, I don't think I'll get a link in "all movies" without creating it manually.

    http://i57.tinypic.com/2usakd2.jpg

    Now, here's the only way it seems to allow consolidating these directories. In this scenario anything I add or change in those 3 directories will update in their links in "all movies" but I can't see their contents displayed all in one directory. Hopefully I'm being clear here.

    http://i59.tinypic.com/303lpo3.jpg

    dimanche 8 février 2015 19:46
  • From what I have seen and read, in order to do exactly what you have shown in those pictures would require a program that scans your computer (or your target folders), and extracts links to the movie files into a separate structure.  For example, I have an NAS that includes such a program.  The script runs whenever a new movie is downloaded, and updates the appropriate structures.  It can also be run on demand.

    You can come close by using a Library, but it won't be set up quite the same.  Here is an example with a Library:

    If I add a file or folder to D:Media\Horror Movies; M:\Media\Comedy Movies or J:\Media\Kung Fu Movies; that will show up in the library.


    Ron

    dimanche 8 février 2015 20:41