I need to store custom data with a file in file system (about 50 bytes with each file). I do not have any other storage to keep the data and can not create an extra file for this. These are my requirements I can not change it.
I have found that this can be done using UserDefinedFileAttributeView class.
What file systems support this feature? NTFS, FAT, any other file systems on Linux?
Where the data is actually stored and how reliable is it?
File attributes are pieces of information associated with every file and directory that includes additional data about the file itself or its contents. They can exist in only one of two states – Set or Cleared; like an On or Off state. Attributes can be in files, directories, volumes and certain system objects.
File attributes are maintained in the file system's directories, and typical attributes are Read-Only, Hidden, System and Archive.
In operating systems like Linux, there are three main file attributes: read (r), write (w), execute (x). Read - Designated as an "r"; allows a file to be read, but nothing can be written to or changed in the file. Write - Designated as a "w"; allows a file to be written to and changed.
I have tested that custom attributes are supported by following file systems via UserDefinedFileAttributeView: NTFS, Ext4, ZFS. Other popular file systems may support them also. No support was found within following file systems FAT32, HFS+.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With