25
6
Possible Duplicate:
What is the difference between NTFS hard links and directory junctions?
What's the difference between them? in examples..
25
6
Possible Duplicate:
What is the difference between NTFS hard links and directory junctions?
What's the difference between them? in examples..
30
The easiest way for most people to understand a symbolic (or soft) link is to think of it as a Windows shortcut.
If you make a symbolic link to a file, when you open it, Windows goes and looks up the original file in the filesystem index and then opens it. You can think of the symbolic link as being a signpost to the original file.
A hard link is an extra entry in the filesystem index that points to the same location on the disk as the original file's name. Think of the original name and the hard link as two doors into the same room.
A junction is a symbolic link to a folder (I think this is a hangover from previous versions of Windows and is now obsolete - I presume, but I haven't checked, that you can just use hard links now).
Should get a −1 for » hard link to a folder «, though. – Joey – 2010-05-17T08:26:39.027
Oops, yes they are symbolic not hard links, I've amended accordingly. I see that the new mklink command still supports creating junctions as well as hard and soft links, but can see no reason for using a junction rather than a link. – Neal – 2010-05-17T15:25:24.487
1When would you choose to use a hard link over a symbolic link and vice versa? – Niko Bellic – 2016-07-13T20:49:19.263
Actually, the documentation does say that hard links can be applied to a folder, it's just a matter of time until someone figures out how to do it. – Hello71 – 2010-07-20T20:08:25.597
10
Junctions are not obsolete and hard links cannot replace junctions as a hard link can only point to a target on the same partition (drive) but a junction in one partition can point to a target in another partition. I found the descriptions in this post very useful.
– orad – 2013-01-20T23:48:30.25011
Directory Junction is "symlink to directory", so you can create "access points" to folders, available since NTFS 5.0 (Windows 2000). Directory Junction is NOT "a hard link to a folder", because junctions can point to non-existent directories. Directory and its junctions can be located on different NTFS partitions, but not across LAN. Non-elevated admins & user can create junctions.
NTFS Symbolic link was added to NTFS in Windows Vista. Symbolic link can point to a file or a directory (compare with junctions). Using them you can create "access points" to files & folders on different NTFS partitions AND across LAN. "The default security settings in Windows Vista disallow non-elevated administrators and all non-administrators from creating symbolic links."
"Symbolic link to directory" vs "Directory Junction" - by my experience, some (many?) apps does not work correctly with symbolic links, but they are fine with junctions, e.g. Total Commander and Windows file sharing (for LAN). If you share a directory with symlink - LAN users cannot traverse it, but they can do it for junctions. So after high-quality thing in Win2k, MS implemented some stuff in Vista...
Hard links can point to files only in the same partition, there is absolutely no difference between first file instance and other hard links to the same file. If you delete some hard link (first instance or another), file will continue to exist unless last hard link is deleted.
Junctions & symbolic links can be "broken" - it you rename/move the target, then they will point to non existent target. So you need to update they in such cases. But hardlinked files can be renamed/moved and all hardlinks will still be the same file, just with different names.
±1 here, +1 for correctly pointing out that a directory junction isn't a hard link, −1 for the third paragraph which goes way downhill. (For the record: Far can traverse directory symlinks just fine; maybe you're just using a broken OFM :-).)
– Joey – 2010-05-17T08:33:08.2073Note to add: Hard links can point to files on the same volume which isn't the same as a partition (a partition is a section of an individual drive, a volume can span many of those and even multiple drives; a volume is what the file system is on, not a partition). – Joey – 2010-05-17T08:34:25.007
2
dupe. There is already a pretty good answer here: http://superuser.com/questions/67870/what-is-the-difference-between-ntfs-hard-links-and-directory-junctions/70117#70117
– Leftium – 2010-05-20T10:51:43.587