fsutil hardlink doesn't work?

Posted by Alix Axel on Stack Overflow See other posts from Stack Overflow or by Alix Axel
Published on 2009-04-28T02:25:12Z Indexed on 2010/05/28 8:11 UTC
Read the original article Hit count: 429

Filed under:
|
|
|

I was looking for a way to create hard links under Windows and I found this page: http://technet.microsoft.com/en-us/library/cc788097.aspx

To try it out, I created a file (1.txt) on the root of my C: drive with 100 lines of the following content:

C:\1.txt (2.598 bytes):

test test test test test

Then I open the command prompt and type:

fsutil hardlink create C:\2.txt C:\1.txt

Success, 2.txt was created but when I go to see it's size it has exactly 2.598 bytes and also noticed some strange behaviours (as far as my understanding of hard links goes):

  1. If I delete 2.txt (the hard linked file) 1.txt is not deleted, and vice-versa.
  2. If I open 2.txt after I delete 1.txt (the original file) the content is still the same.

How does the fsutil hardlink create command differs from the copy command? And how can I create a true hard link under Windows?

I'm using Windows XP SP 3, and my file system is NTFS.

© Stack Overflow or respective owner

Related posts about Windows

Related posts about link