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,605

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.

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,896