TIPS
Volver
ELIMINACIÓN DE UN TIP
Título:
Shortcuts, simbolic links y junctions
Texto:
So in Windows what is the difference between a short-cut and symbolic link (sym-link) and a hard link? Well a short cut is basically a file that points to another file. It is an antiquated, pointing system from the Windows 95 days. Shortcuts not only use up space on your hard drive, they also linger around after the item they are pointing to has been deleted and break if the item is renamed. A symbolic link is like a short cut, but instead of being saved as a file, they are registered to the file system. This means they do not use hard disk space; all programs recognise and can read where the link is pointing to. A symbolic link can point to any file, folder either locally on the computer or over a network using a SMB path. A file hard link and the directory junction are a little different. It not only points to the item but duplicates it, but does so without taking up the extra hard disk space required by a copied file. Also if you have a hard link pointing to a file then delete that original file, the hard link will still retain a copy. A limitation of the file hard link though is that the link can only be made on the same file partition as the file. Finally a junction is a hard link for directories. To me they are the most useful and unlike file hard links, you can create junctions on different partitions to where the original folder is located. Again a junction is stored on the file system, does not take up space and is treated by the operating system and programs as a local folder. Windows Vista/7 uses the command line program called mklink to create these symbolic links. It has 3 arguments and then requires both a link name and target. mklink /D /H /J [LINK NAME] [TARGET] Now there are 4 modes for mklink and they all counteract each other meaning you can only use one argument or none at all. No arguments creates file symbolic link which is like a shortcut that is registered on the file system instead of stored in a file. /D creates a directory symbolic link which is like a shortcut that is registered on the file system instead of stored in a file. /H creates what Windows refers to as a hard file link. A hard file link is used where you need multiple copies of a file, but wish to save space by keeping only one physical copy on disk. /J creates a Windows Junction which is a directory hard link. If you need duplicate copies of a directory but don’t wish to use up the extra hard drive space you can create a junction. Though be careful as any changes you make to a file or folder in one of the junction will affect all the others. mklink /J WindowsVista C:Windows Would make a Windows Junction titled WinVista linking to the directory C:Windows