Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • December 10, 2016, 08:46:10 AM
  • Proudly celebrating 10 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: "Pointer" Directories in Windows  (Read 8530 times)

Deozaan

  • Charter Member
  • Joined in 2006
  • ***
  • Points: 1
  • Posts: 7,724
    • View Profile
    • The Blog of Deozaan
    • Read more about this member.
    • Donate to Member
"Pointer" Directories in Windows
« on: February 02, 2010, 09:05:18 PM »
So I've really been interested lately in something that has been mentioned a few times on these forums. I don't know what they're called, but basically you can create a "pointer directory" that doesn't really exist, but just points to another directory located somewhere else in your computer.

This way you can have something like:

C:\Users\Username\Documents\My Dropbox\Games\Diablo II\Saves\

Which really puts all the files in:

D:\Games\Diablo II\Saves\

As you can see from the example, one of the purposes I have for this is to back up/synchronize files from places that don't tidily fit into the normal DropBox folder.

Any help on what these "pointer directories" are and how to make them would be greatly appreciated. Thanks!


f0dder

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,029
  • [Well, THAT escalated quickly!]
    • View Profile
    • f0dder's place
    • Read more about this member.
    • Donate to Member
Re: "Pointer" Directories in Windows
« Reply #1 on: February 02, 2010, 09:10:31 PM »
NTFS Junction Points - there's no Explorer functionality for creating/modifying, and I can't remember what the commandline tools are named (nor whether they're included with Windows or require a resource kit/whatever). But powerful file managers like xplorer2 can manage them. Btw, be VERY careful when dealing with junctions in standard Explorer - deleting a junction won't just delete the junction, but also the folder it points to!

And when doing junctions, also keep in mind that it's possible to create circular/endlessly-recursive hierarchies... you really don't want to do this. Apart from juctions, there's also SymLinks - but those weren't introduced until Vista (whereas Junctions are Win2000 and later), and I frankly don't know much about how SymLinks work.

Junctions require NTFS filesystem, but obviously you're running that and not FAT :)
- carpe noctem

Deozaan

  • Charter Member
  • Joined in 2006
  • ***
  • Points: 1
  • Posts: 7,724
    • View Profile
    • The Blog of Deozaan
    • Read more about this member.
    • Donate to Member
Re: "Pointer" Directories in Windows
« Reply #2 on: February 02, 2010, 09:17:15 PM »
Aha! Thanks for the info!

A quick Google of SymLinks and NTFS Junctions reveals the following information:

How-To Geek explains: Using SymLinks in Windows Vista (with commandline ... commands).
Microsoft explains: How to create and manipulate NTFS Junction points (with commandline tools).

From the first link it appears as though using SymLinks for a directory actually creates a Junction.


ewemoa

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 2,845
    • View Profile
    • Donate to Member
Re: "Pointer" Directories in Windows
« Reply #3 on: February 02, 2010, 09:17:41 PM »
I recently came across the following article and found it helpful:

  http://shell-shocked.org/article.php?id=284

One of the few non-portable things I've been using is:

  http://elsdoerfer.name/=ntfslink

I believe this tool helps (in some cases?) w/ the problem that f0dder mentioned about deletion.

(I'm thinking of applying some of this to moving my profile to another partition or drive.)

Deozaan

  • Charter Member
  • Joined in 2006
  • ***
  • Points: 1
  • Posts: 7,724
    • View Profile
    • The Blog of Deozaan
    • Read more about this member.
    • Donate to Member
Re: "Pointer" Directories in Windows
« Reply #4 on: February 02, 2010, 09:29:37 PM »
One of the problems I'm having is that I install my programs on a drive other than C, and I told Windows to use my A drive instead for Program Files, but when programs install using the default information, they install to Program Files on C, but the shortcuts are made pointing to A, so I get a lot of broken shortcuts and things.

I'm trying to create a SymLink now, but it won't let me create one for a directory that already exists.

Another example is that I keep my documents and other profile information on my D drive, but Windows won't let me remove the C:\Users\ directory, all the real data is in D:\Users\

But I can't create a SymLink/Junction because C:\Users already exists. Any tips on getting this to work?


f0dder

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,029
  • [Well, THAT escalated quickly!]
    • View Profile
    • f0dder's place
    • Read more about this member.
    • Donate to Member
Re: "Pointer" Directories in Windows
« Reply #5 on: February 02, 2010, 09:55:10 PM »
I'm trying to create a SymLink now, but it won't let me create one for a directory that already exists.
Indeed not, that would be pertty disastrous :). You can make a junction for each application you're going to install, but this is obviously going to be a bit painful.

Another example is that I keep my documents and other profile information on my D drive, but Windows won't let me remove the C:\Users\ directory, all the real data is in D:\Users\
To do this, you'd have to boot from BartPE or similar, move the folder to the destination, then create the junction. I'm not sure it's a good idea trying to move C:\Users this way, though.
- carpe noctem

Deozaan

  • Charter Member
  • Joined in 2006
  • ***
  • Points: 1
  • Posts: 7,724
    • View Profile
    • The Blog of Deozaan
    • Read more about this member.
    • Donate to Member
Re: "Pointer" Directories in Windows
« Reply #6 on: February 02, 2010, 09:59:22 PM »
Another example is that I keep my documents and other profile information on my D drive, but Windows won't let me remove the C:\Users\ directory, all the real data is in D:\Users\
To do this, you'd have to boot from BartPE or similar, move the folder to the destination, then create the junction. I'm not sure it's a good idea trying to move C:\Users this way, though.

Hmm... It's something to think about. Thanks for the help!


wraith808

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 8,408
  • "In my dreams, I always do it right."
    • View Profile
    • Donate to Member
Re: "Pointer" Directories in Windows
« Reply #7 on: February 02, 2010, 10:05:30 PM »
Here is a shell integration for the functionality... I use it extensively.

http://schinagl.priv...ardlinkshellext.html

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,258
    • View Profile
    • Coding Snacks by Lanux128
    • Read more about this member.
    • Donate to Member
Re: "Pointer" Directories in Windows
« Reply #8 on: February 03, 2010, 12:17:25 AM »
i'm linking some of the previous DoCo discussions, might give a clearer understanding of how SymLinks work. however i'm not a fan of junctions for the reason f0dder stated in his post.

http://www.donationc...dex.php?topic=4024.0
http://www.donationc...dex.php?topic=8971.0

Deozaan

  • Charter Member
  • Joined in 2006
  • ***
  • Points: 1
  • Posts: 7,724
    • View Profile
    • The Blog of Deozaan
    • Read more about this member.
    • Donate to Member
Re: Folder Junctions and SymLinks for Dropbox
« Reply #9 on: February 03, 2010, 05:21:40 AM »
I just tested out using Junctions to point "My Dropbox\Games\Diablo II\save" to "Games\Diablo II\save" and it appears to be working properly as far as the fact that it's the same folder and same files, unfortunately it doesn't work at all with regard to Dropbox recognizing the files are changing and synchronizing to the cloud or to other computers.

Has anyone else successfully gotten something like this to work with Dropbox?


lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,258
    • View Profile
    • Coding Snacks by Lanux128
    • Read more about this member.
    • Donate to Member
Re: "Pointer" Directories in Windows
« Reply #10 on: February 03, 2010, 05:47:59 AM »
the post here by justice seems to indicate that it is possible to do that with Dropbox.

http://www.donationc....msg121937#msg121937

Deozaan

  • Charter Member
  • Joined in 2006
  • ***
  • Points: 1
  • Posts: 7,724
    • View Profile
    • The Blog of Deozaan
    • Read more about this member.
    • Donate to Member
Re: "Pointer" Directories in Windows
« Reply #11 on: February 03, 2010, 05:53:34 AM »
the post here by justice seems to indicate that it is possible to do that with Dropbox.

http://www.donationc....msg121937#msg121937

That's the extension I used to create the junction.

I wonder if it's a Windows 7 or 64-bit issue...


Eóin

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 1,401
    • View Profile
    • Donate to Member
Re: "Pointer" Directories in Windows
« Reply #12 on: February 03, 2010, 05:56:56 AM »
Btw, be VERY careful when dealing with junctions in standard Explorer - deleting a junction won't just delete the junction, but also the folder it points to!

Is that true for sure. I use junctions quite a bit created through Link Shell Extension and deleting them (i.e. NOT using the added 'Delete junction' menu entry) never deleted the source folder. However not having used them without the extension installed perhaps that behaviour differs.

f0dder

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,029
  • [Well, THAT escalated quickly!]
    • View Profile
    • f0dder's place
    • Read more about this member.
    • Donate to Member
Re: "Pointer" Directories in Windows
« Reply #13 on: February 03, 2010, 06:20:33 AM »
Eóin: might be LSE that intercepts the delete, or perhaps Explorer has gotten a bit smarter with Vista and onwards... but it definitely used to be a problem :)
- carpe noctem

wraith808

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 8,408
  • "In my dreams, I always do it right."
    • View Profile
    • Donate to Member
Re: "Pointer" Directories in Windows
« Reply #14 on: February 03, 2010, 07:09:24 AM »
I just tested out using Junctions to point "My Dropbox\Games\Diablo II\save" to "Games\Diablo II\save" and it appears to be working properly as far as the fact that it's the same folder and same files, unfortunately it doesn't work at all with regard to Dropbox recognizing the files are changing and synchronizing to the cloud or to other computers.

Has anyone else successfully gotten something like this to work with Dropbox?

I know that when I use LSE to create junctions, sometimes I have to press refresh in order for the folder contents to refresh if I've gone through the junction.  Maybe you can do it in reverse.  Create the actual directory as your dropbox directory, then create a junction for diablo 2 to point to it?

Deozaan

  • Charter Member
  • Joined in 2006
  • ***
  • Points: 1
  • Posts: 7,724
    • View Profile
    • The Blog of Deozaan
    • Read more about this member.
    • Donate to Member
Re: "Pointer" Directories in Windows
« Reply #15 on: February 03, 2010, 05:24:12 PM »
Btw, be VERY careful when dealing with junctions in standard Explorer - deleting a junction won't just delete the junction, but also the folder it points to!

Is that true for sure. I use junctions quite a bit created through Link Shell Extension and deleting them (i.e. NOT using the added 'Delete junction' menu entry) never deleted the source folder. However not having used them without the extension installed perhaps that behaviour differs.

When I delete a Junction folder, it doesn't delete the folder in the other location, but it does delete all the contents of the folder.

Maybe you can do it in reverse.  Create the actual directory as your dropbox directory, then create a junction for diablo 2 to point to it?

That worked! But now the game freezes up momentarily every second or two. Bummer.


wraith808

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 8,408
  • "In my dreams, I always do it right."
    • View Profile
    • Donate to Member
Re: "Pointer" Directories in Windows
« Reply #16 on: February 03, 2010, 10:36:21 PM »
Hmmm... I wonder if AHK could be the answer?  Create an extra file in the directory, and have AHK touch that file through the junction at intervals?   So Diablo 2 doesn't freeze up?  You'd probably experience a bit of lag b/c AHK would have the same problem going through a junction.  But if you set it to only do it every 30 minutes while Diablo 2 was up, it might not be such an imposition...

f0dder

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,029
  • [Well, THAT escalated quickly!]
    • View Profile
    • f0dder's place
    • Read more about this member.
    • Donate to Member
Re: "Pointer" Directories in Windows
« Reply #17 on: February 04, 2010, 01:52:37 AM »
Going through a junction shouldn't really cause any speed hiccup - it sounds more likely DII takes a speed hit because DropBox backs up files it's using?
- carpe noctem

wraith808

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 8,408
  • "In my dreams, I always do it right."
    • View Profile
    • Donate to Member
Re: "Pointer" Directories in Windows
« Reply #18 on: February 04, 2010, 09:27:20 AM »
I've noticed that going through a junction does cause a speed hiccup- and it doesn't always refresh the directories.

Deozaan

  • Charter Member
  • Joined in 2006
  • ***
  • Points: 1
  • Posts: 7,724
    • View Profile
    • The Blog of Deozaan
    • Read more about this member.
    • Donate to Member
Re: "Pointer" Directories in Windows
« Reply #19 on: February 04, 2010, 01:21:39 PM »
I thought Diablo II only updated (saved) character data every few minutes anyway. Sometimes I've brought up task manager and chose "End Task" to quit without it saving changes.

I've definitely gone longer than 1 or 2 seconds, which is how often D2 is freezing up.

Though I suppose it could be the other files D2 creates, relating to the maps.


wraith808

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 8,408
  • "In my dreams, I always do it right."
    • View Profile
    • Donate to Member
Re: "Pointer" Directories in Windows
« Reply #20 on: February 04, 2010, 01:38:27 PM »
I thought Diablo II only updated (saved) character data every few minutes anyway. Sometimes I've brought up task manager and chose "End Task" to quit without it saving changes.
CHEATER!!!!  :P

I've definitely gone longer than 1 or 2 seconds, which is how often D2 is freezing up.

Though I suppose it could be the other files D2 creates, relating to the maps.
I still wonder if the solution is to get the junction directory to recognize the change.  Do you think that AHK could look at the file to see when the timestamp changes, then touch the file again through the junction?

Deozaan

  • Charter Member
  • Joined in 2006
  • ***
  • Points: 1
  • Posts: 7,724
    • View Profile
    • The Blog of Deozaan
    • Read more about this member.
    • Donate to Member
Re: "Pointer" Directories in Windows
« Reply #21 on: February 04, 2010, 08:58:33 PM »
I still wonder if the solution is to get the junction directory to recognize the change.  Do you think that AHK could look at the file to see when the timestamp changes, then touch the file again through the junction?

I'm not sure what that means, to be honest.


f0dder

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,029
  • [Well, THAT escalated quickly!]
    • View Profile
    • f0dder's place
    • Read more about this member.
    • Donate to Member
Re: "Pointer" Directories in Windows
« Reply #22 on: February 05, 2010, 12:40:20 AM »
I've noticed that going through a junction does cause a speed hiccup- and it doesn't always refresh the directories.
Hm, interesting - I can't OTOH think of a reason junctions should cause speed hiccups... they might involve an extra ACL lookup, and the need to read FS metadata for the destination could introduce a little disk seeking. But enough to cause a hiccup? Hmm!

And what with the "doesn't always refresh" - how does this manifest itself?
- carpe noctem

wraith808

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 8,408
  • "In my dreams, I always do it right."
    • View Profile
    • Donate to Member
Re: "Pointer" Directories in Windows
« Reply #23 on: February 05, 2010, 08:21:12 AM »
I've noticed that going through a junction does cause a speed hiccup- and it doesn't always refresh the directories.
Hm, interesting - I can't OTOH think of a reason junctions should cause speed hiccups... they might involve an extra ACL lookup, and the need to read FS metadata for the destination could introduce a little disk seeking. But enough to cause a hiccup? Hmm!

And what with the "doesn't always refresh" - how does this manifest itself?
The speed hiccup manifests itself in the opening of file dialogs or the browsing to the directory.  If I open a file dialog that defaults to a junction, or browse through a junction in a file dialog (or sometimes in explorer), there will be a short pause while the junction is opened.  Once I'm in the junction, it's fine- but that first crossing of the junction can make it pause.  It's a short pause, but it's there.

The doesn't always refresh- If I copy a file to the junction and have a window open to the directory, the file appears in the window I have open to the directory.  In that same scenario, if I copy a file over through the regular directory, it doesn't appear in the junction until I explicitly refresh the directory.  By 'always' I mean that I can't say with certainty that other programs don't see the copied file, but I've had some strange occurences, though it's not frequent enough to override the use of junctions.

I still wonder if the solution is to get the junction directory to recognize the change.  Do you think that AHK could look at the file to see when the timestamp changes, then touch the file again through the junction?

I'm not sure what that means, to be honest.
As for your case Deozaan, I think that Dropbox uses file date/time stamps to see when to update a file (among other things), so that if you changed the file date/time stamp through the junction, Dropbox might pick it up.  That's just a hypothesis, though.  I think that AHK could do this fairly easy... I'm not well-versed in AHK yet, but if no-one speaks up, I can probably give it a go.

wraith808

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 8,408
  • "In my dreams, I always do it right."
    • View Profile
    • Donate to Member
Re: "Pointer" Directories in Windows
« Reply #24 on: February 11, 2010, 03:02:37 PM »
I saw another piece of software that helps with junctions (also free) on free download a day... http://www.rekenwonder.com/linkmagic.htm

I haven't tried it, but figured I'd post it.