Welcome to the JaguarPC Community
JaguarPC
Sales: (888) 338-5261
Support: (888)-551-3050
Results 1 to 7 of 7

This is a discussion on SymLinks on Windows! (Power users only!!) in the Open Discussion & Chit-chat forum
I never knew you could do this, but it is pretty cool! If you are a *nix power user, one of the things that has ...

  1. #1
    Community Leader jason's Avatar
    Join Date
    Sep 2001
    Location
    Rochester, NY
    Posts
    6,003

    SymLinks on Windows! (Power users only!!)

    I never knew you could do this, but it is pretty cool!

    If you are a *nix power user, one of the things that has probably really frustrated you when you're in Windows is that Windows doesn't have symbolic links. The closest thing, Windows shortcuts, only work in Explorer: if you double click on a shortcut it will open its target, but you can't, for example, reference a shortcut in code and expect to get the contents of the target file when you do an fopen() on the shortcut path.

    Well, if you're running NTFS 5.0 or better (Win 2k or better), there is a feature of the filesystem called a reparse point (also known as a junction point) that works very much like a unix symlink. They aren't wel documented by MS, but there are a handful of third-party utilities to work with them.

    The easiest way I've found to create reparse points is with a free program from SysInternals (now part of MS) called junction. You can download junction from http://www.microsoft.com/technet/sys.../Junction.mspx.

    Open the zip file and drop junction.exe to some folder in your path, then open a command prompt and type
    Code:
    junction c:\link-name c:\path\to\target
    Note: the syntax is backwards from the unix ln -s syntax, which would be ln -s /path /to/target link-name

    Junction points can point to files or directories and they can span volumes. For example:
    Code:
    junction c:\d-drive d:\
    will create a junction point at c:\d-drive that will point to the root directory of your d: drive.

    Junctions appear just like file folders in Windows Explorer. They show up in command line "dir" output as <JUNCTION>, however.

    WARNING: It appears that if you delete a junction point from the explorer you may delete the target as well (including all files in the directory if the target is a directory)! Therefore you should use a junction point management tool (like Sysinternals' junction) to remove junction points.

    Here's a good reference on the topic: http://shell-shocked.org/article.php?id=284

    Does anyone else know about this? I wish I had known about it sooner.
    Jason Pitoniak
    Interbrite Communications
    www.interbrite.com www.kodiakskorner.com

  2. #2
    Loyal Client Pawel Kowalski's Avatar
    Join Date
    Sep 2001
    Location
    Albuquerque NM
    Posts
    1,405
    Thanks for posting that. Really shortcuts have worked just well in all the things I've been wanting to as I never had issues with a windows program recognizing a ink file. If I ever do I'll be sure to check out this solution. Thanks.

  3. #3
    the Windlord Gwaihir's Avatar
    Join Date
    Jun 2002
    Posts
    2,562
    NTFS junctions are more like hard links than they are like sym links. There's another thingy called "shell link" that's more like a symlink. (Is that the shortcut explorer uses too? Anyway; these aren't explorer only, but if a program isn't programmed to respect them, it will ignore them.)

    I use the freeware GUI tool Winbolic Link (www.pearlmagik.com) to manage both. Mainly I have a few junctions to make various development folders accessible from under the localhost Apache webroot, for some quick testing. (Apache ignores the shell links.)

    You're quite right about the power users only not. One has to be carefull with junctions; they are made at a very low level, in the NTFS filesystem. Your OS and applications are totally oblivious to them, so do watch out that you for example don't get your backup program in an endless loop. If you create a junction that points back to higher up in the same filesystem tree, it would get stuck in that loop, thinking it's still following the tree ever further down.
    Regards,

    Wim Heemskerk
    ---
    Visit MeCCG.net - Cardgaming in J.R.R. Tolkien's Middle-earth
    And Gwaihir.net - The Middle-earth CCG store

  4. #4
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,775
    Cool!

    So, you're saying (jason) that I could, for instance, FTP into my site using Internet Exploder, open a folder window, symlink using a junction point, and have my account at JagPC come up as a local drive, instead of remote folders?
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL © 2010

  5. #5
    Community Leader jason's Avatar
    Join Date
    Sep 2001
    Location
    Rochester, NY
    Posts
    6,003
    I think it only works for NTFS->NTFS junctions, so I doubt you'd be able to point the jusction at an FTP "share."

    I run FreeSSHd on a couple of Windows boxes so that I can make tunnels to them and whanot. One drawback of the software though is that the SFTP server it includes limits you to a single directory tree (by default its $HOME--the logged in user's home directory). I have a system on which I'd like to access files on both C: and D: and I haven't been able to do that, but with a junction point on c:\ that points to d:\ I now can. (I haven't tried Gwaihir's tool on it yet, but I plan to.)

    --Jason
    Jason Pitoniak
    Interbrite Communications
    www.interbrite.com www.kodiakskorner.com

  6. #6
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,775
    I see...

    Okay, Mr. Power User... what's the bene to 'us', then?
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL © 2010

  7. #7
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,775

    Lightbulb Update

    Windows Vista

    Windows Vista supports a new NTFS symbolic link capability that replaces junction points in Windows 2000 and Windows XP. Microsoft has implemented its symbolic links to function just like UNIX links. They are designed to aid in migration and application compatibility with UNIX operating systems. Microsoft uses them internally to maintain backward naming convention compatibility for user's profile's among other things.

    EDIT

    Extra Credit Reading
    Last edited by Vin DSL; 10-21-2007 at 04:15 PM.
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL © 2010

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •