Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

The story: I recently started trying DropBox. After some fiddling, I found I could use an app, DropBoxFolderSync, to sync a folder with DropBox, leaving something called a "Symbolic Link" (which seems analogous to a pointer in programming) at the previous folder location.

Sounded good and I could always copy the real files back out of DropBox, so I used that on my programming projects folder - Always good to have offsite storage.

However, it's always good to have a local backup, too, so I had previously dropped my Projects folder on the C:\ partition to a Briefcase on the D:\ partition.

So, to sum up:

  • Projects folder backed up to Briefcase.

  • Did some work, decided to give DropBox a shot.

  • Projects folder synced to DropBox using DropBoxFolderSync; symbolic links left behind.

  • Then, I updated the Briefcase, because I had done some work since I last updated it. Some files were copied over.

A listing of folders:

  • Projects Folder: "C:*\Visual Studio 2010\Projects" (Contains symbolic links)

  • DropBox Projects Folder: "C:*\DropBox\Projects" (Contains the actual files)

  • Briefcase: *"Backups\Visual Studio 2010 Projects" on the D: drive (references the Project Folder)

Now, my question is: Will the Briefcase accumulate the symbolic links, or the actual files? That is, in programming speak (because it's what I know), will it copy the pointer or the referenced value?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

It will copy the files (referenced values). This is the default behavior of hardlinks. Technically, these aren't symbolic link.

To copy the hardlink(NTFS calls them junctions if they point to a folder instead of a file) you have to explicitly call a CreateHardLink function. You can safely assume any program not specifically hardlink aware will always copy the "referenced value."

BTW, symlinks are different in that they are literally a file that holds the path to their target.

edit

For the nerds that are reading. . .

Hardlinks and Junctions in NTFS http://msdn.microsoft.com/en-us/library/aa365006(v=VS.85).aspx

The result of different functions when performed on a symbolic link http://msdn.microsoft.com/en-us/library/aa365682(v=VS.85).aspx

share|improve this answer
    
NTFS junctions technically are not hardlinks. A junction is always a symbolic pointer to the original path, almost like a symlink but with different path resolution rules. (Also, the original question appears to be talking about symbolic, not hard, links?) –  grawity Sep 26 '11 at 7:25
    
My point here was the OS will treat Hardlinks and Junctions the same way when they are copied. Only by calling explicit functions will the links themselves be duplicated. Otherwise it is safe to assume that they are treated like their targets. –  surfasb Sep 26 '11 at 12:28
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.