Monday, March 25, 2013

Links: Hard and Symbolics - Windows DRAFT

How to deal with links in windows, here we will need ntfs. Because that feature isn't available in FAT.
We wiil use 2 tools:
  • fsutil
  • mklink

I will do the same as with Linux:
echo "FILE 1" >FILE-1.txt
 
cat FILE-1.txt
"FILE 1"
 
fsutil hardlink create FILE-2.txt FILE-1.txt
Hardlink created for D:\opt\temp\DIR1\FILE-2.txt <<===>> D:\opt\temp\DIR1\FILE-1.txt
dir
 Volume in drive D is DATA
 Volume Serial Number is 7637-FD99

 Directory of D:\opt\temp\DIR1

25/03/2013  17:04    <DIR>          .
25/03/2013  17:04    <DIR>          ..
25/03/2013  16:55                 9 FILE-1.txt
25/03/2013  16:55                 9 FILE-2.txt
               2 File(s)             18 bytes
               2 Dir(s)  39 250 927 616 bytes free

type FILE-1.txt
FILE 1
type FILE-2.txt
FILE 1
del FILE-1.txt

dir
 Volume in drive D is DATA
 Volume Serial Number is 7637-FD99

 Directory of D:\opt\temp\DIR1

25/03/2013  17:55    <DIR>          .
25/03/2013  17:55    <DIR>          ..
25/03/2013  16:55                 9 FILE-2.txt
               1 File(s)              9 bytes
               2 Dir(s)  39 250 927 616 bytes free
              
type FILE-2.txt
FILE 1
So, we have the same result for the hardlink. I will update both post, to see what happen with directory links.

No comments: