6

An interesting thought just occurred to me while thinking about NTFS.

NTFS supports hard links, symbolic links, and Alternate Data Streams. Is it possible for an ADS to be a link to another file? Conversely, do the Alternate Data Streams attached to a link belong to the link itself or to the underlying filesystem data?

hippietrail
  • 4,505
  • 15
  • 53
  • 86
Andrew Lambert
  • 7,635
  • 3
  • 30
  • 47
  • No. NTFS supports links, _reparse points_, and multiple data streams. – JdeBP Dec 11 '11 at 11:21
  • @JdeBP False. See [here](http://support.microsoft.com/kb/105763) for more. – soandos Dec 11 '11 at 11:37
  • Pointing to a MSKB article that says, as I did, that NTFS supports multiple data streams is not actually evidence of falsehood. And the KB article doesn't say _anything_ about _reparse points_ at all. Here's a hint: You won't find a MSKB article that contradicts what I wrote, because what I wrote is not, in fact, false. ☺ – JdeBP Dec 11 '11 at 11:50
  • NTFS has supported all three since Windows Vista. Hard links and ADSes since Windows NT 3.1. Reparse points were introduced in Windows 2000 with NTFS v3. (see [here](http://web.archive.org/web/20080506103326/http://msdn.microsoft.com/en-us/library/ms810604.aspx), and [here](http://en.wikipedia.org/wiki/NTFS)) – Andrew Lambert Dec 11 '11 at 11:52
  • 2
    @Amazed: Symlinks are just a form of reparse points (several other forms are junctions and mount points). – u1686_grawity Dec 11 '11 at 21:44

2 Answers2

6

I tried it. Here are my results:

> echo "test" > test.txt
> echo "ads of test" > test.txt:myads
> mklink /H test2.txt test.txt
  Feste Verknüpfung erstellt für test2.txt <<===>> test.txt
                    # In English: Hard link created for test2.txt
> more < test2.txt:myads
  "ads of test"
> mklink test3.txt test.txt
  symbolische Verknüpfung erstellt für test3.txt <<===>> test.txt
                    # In English: symbolic link created for test3.txt
> more < test3.txt:myads
  "ads of test"

The behavior indicates that the ADS is attached to the filesystem data and not the directory entry.

Marcel Nolte
  • 61
  • 1
  • 2
0

Is it possible for an ADS to be a link to another file?

AFAIK, this is not possible.

Alternate Data streams literally specify an alternate data attribute in the file's MFT entry. If two MFT entries both specify to the same cluster(s), which you cannot do.

Conversely, do the Alternate Data Streams attached to a link belong to the link itself or to the underlying filesystem data?

Alternate Data Streams are recorded in the MFT and not the link itself ( I'm assuming you mean directory entry.)

http://technet.microsoft.com/en-us/library/cc976808.aspx

surfasb
  • 22,452
  • 5
  • 52
  • 77