28 December 2009 0 Comments

Symbolic Links in Windows Vista / Windows 7

The Windows Vista I/O-related changes include file-based symbolic links, more efficient I/O completion processing, comprehensive support for I/O cancellation, and prioritized I/O. A file system feature many have considered missing from NTFS, the symbolic file link (or as it’s called in UNIX, the soft link) finally arrives in Windows Vista (Win 7). The Windows 2000 version of NTFS introduced symbolic directory links, called directory junctions, which allow you to create a directory that points at a different directory, but until the Windows Vista version, NTFS has only supported hard links for files.

A major difference in the way Windows resolves symbolic links and directory junctions is where the processing takes place. Windows processes symbolic links on the local system, even when they reference a location on a remote file server. Windows processes directory junctions that reference a remote file server on the server itself. Symbolic links on a server can therefore refer to locations that are only accessible from a client, like other client volumes, whereas directory junctions cannot. To address this, Windows Vista supports the new symbolic link type for both files and directories.

Many file system commands have been updated to understand the implications of symbolic links. For example, the Delete command knows not to follow links, which would result in deletion of the target, but to delete the link instead. However, because not all applications may handle symbolic links correctly, creating a symbolic link requires the new Create Symbolic Link privilege that only administrators have by default.

You can create a symbolic link from a command prompt with the Mklink command. The command prompt’s built-in directory command identifies a symbolic link by flagging it with <SYMLINK> and showing you the target in brackets.

cc162494.fig05_L(en-us) 

Windows Explorer is also symbolic-link-aware and shows them with the short-cut arrow. You can see the target of a link in Explorer by adding the Link Target column to the browsing window.

Symbolic_Link

In a way, this gives symbolic links extra flexibility, as you can create a symbolic link to a file or folder that doesn’t actually exist, but will later. Symbolic links take up no space, and if you delete a symbolic link, nothing happens to the original data.

Difference Between a Hardlink and Symbolic Link

A hard link is functionally very similar to a symbolic link, but is fundamentally different. Rather than pointing to a part of the file system, a hardlink points to data in memory. In other words, when you create a hard link, you’re not merely creating a link or a shortcut to another file—you’re creating a new file which points to already extant data.

Hard_link

Resources

1. Technet – Microsoft

2. MaximumPC