So I have created a bunch of symbolic links to top of source code tree, data directories, etc
How do I, from command line, cd to these links?
|
So I have created a bunch of symbolic links to top of source code tree, data directories, etc How do I, from command line, cd to these links? | |||
|
feedback
|
This question came from our site for professional and enthusiast programmers.
|
Are you sure you actually created symbolic links, or did you create a Windows Shortcut? Those are not links, and don't work as such. Actual symbolic links behave like other directories, so if you are unable to (If you want to create NTFS symlinks, there's a free-to-use utility called Junction, downloadable from the MS site.) As a parable, imagine a river and its tributaries: all those rivers flow into the large river; that is the directory structure; riverside towns are files. Now, a Windows Shortcut is just a sign on the riverbank: "it's not here, you need to go back down to Mississippi and then up Ohio, it is five miles upstream, on the left bank" - but you need to read English to understand it (have a program which handles this for you, e.g. Explorer.exe). A symlink is like a water canal: if you follow it, it will actually take you someplace else, no matter whether you can read English or not (no matter what program you use). | |||||||||||||
feedback
|
|
Symbolic links are normal directories. | |||||||||||||
feedback
|
|
Example: Target folder is d:\code\ , I made a shortcut (rightclick-drag-drop) to it in C:\ see snapshot:
The 'shortcut' is an .lnk file which has the target path (D:\code)and a bunch of other junk in it ie. computer name (kandalf) and god knows what else. You could parse the .lnk file and use the path inside it. Too much trouble? why not use full paths in your config file/whatever it is you're doing? ;) As a last resort I'd go for NTFS Junctions... Last resort because, the windows file manager is stupid, ie. when you delete a junction it doesn't just delete the junction; it deletes the junction AND the target folder and all it's files! Now think of that junction sitting under a deep directory structure in an obscure folder that you later want to delete -- yup you guessed it! | |||||
feedback
|