2

There are some .txt, doc and other extension type of files in a folder now i want to add custom properties on all file how to do it ? there are already some attribute like Location, Size, Size on Disk, created on , modify on so i want to add another property like "version".

Jeevan Bhatt
  • 5,881
  • 18
  • 54
  • 82

1 Answers1

1

You could consider using ADS (alternate data streams) which is an NTFS feature. ADS allow you to attach content to files on NTFS file systems. From the point-of-view of the user, there is a single file, but this file may have additional streams attached to it which will not be visible from Explorer for example. When the file is copied directly between NTFS file systems, the streams get copied too.

Alternate data streams are used by the OS to tag files with information such as what zone a file arrived from (e.g. the internet) and this drives security warning dialogs in such cases.

An example of using streams from C# can be found here:

NTFS Alternate Data Streams - .NET

Pros:

  • No loose files containing your extra meta-data.
  • When files are copied on NTFS file systems, streams are automatically copied.

Cons:

  • Only works on NTFS e.g. not FAT32.
  • If a file is copied onto another file system format, streams are lost.
  • If a file is packaged via some other fornat (e.g. as an email attachment) the streams may be lost.
Community
  • 1
  • 1
Tim Lloyd
  • 37,954
  • 10
  • 100
  • 130