fileattributesmetadatantfs

How can I add NTFS metadata to any file?


Is there a possibility to add information like "Version = 1.2.3.4" to - let's say - a TXT file? Could this be achieved with NTFS metadata? If so, can I set such information by a program?

Thanks in advance for any hint! Bernd


Solution

  • You can use either Alternative Data Stream (ADS), or Extended File Attributes (more e.g. here).

    If you are sure your files remain on NTFS, Alternative Data Streams are perfect way how to store any amount of alternative data - but you will lose ADS when such file leaves NTFS.

    Another option is to use Extended File Attributes, it's supported cross-platform, cross-FS, but it has limitations (e.g. how much data you can store). If you're going to save just e.g. version information, this is probably the best way to go.