NTFS extended file attributes in C++
-
I wish to read and write NTFS extended file attributes in C++. I was very surprised that I did not find this information readily available. First I am assuming that NTFS extended file attributes are name-value pairs of strings. Is this correct? May I create a name and a value and attach that to a file as an extended file attribute? Presuming that that is correct, how do I 1) Determine whether a file supports extended file attributes (resides on a NTFS drive) 2) Read the extended file attributes 3) Set the extended file attributes I am in a VC++ 6 environment. Thanks
-
I wish to read and write NTFS extended file attributes in C++. I was very surprised that I did not find this information readily available. First I am assuming that NTFS extended file attributes are name-value pairs of strings. Is this correct? May I create a name and a value and attach that to a file as an extended file attribute? Presuming that that is correct, how do I 1) Determine whether a file supports extended file attributes (resides on a NTFS drive) 2) Read the extended file attributes 3) Set the extended file attributes I am in a VC++ 6 environment. Thanks
gokings wrote: ...NTFS extended file attributes... Just so we are on the same page here, what is your definition of "NTFS extended file attributes."
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
-
I wish to read and write NTFS extended file attributes in C++. I was very surprised that I did not find this information readily available. First I am assuming that NTFS extended file attributes are name-value pairs of strings. Is this correct? May I create a name and a value and attach that to a file as an extended file attribute? Presuming that that is correct, how do I 1) Determine whether a file supports extended file attributes (resides on a NTFS drive) 2) Read the extended file attributes 3) Set the extended file attributes I am in a VC++ 6 environment. Thanks
GetVolumeInformation() will tell you if the driver is NTFS. GetFileSecurity() can also tell you, if it fails you're not on NTFS and will get the "Security Information" if this is what you mean by extended. GetFileAttributes() works on basic FAT r/w/h/s attributes. GetFileAttributesEx() gets a few more attributes. GetFileInformationByHandle() gets a bunch of crap. Or are you talking about "extended attributes" as in: Extended Attribute Information Used by file servers that are linked with OS/2 systems. This attribute type isn't useful to Windows NT. Extended Attributes Used by file servers that are linked with OS/2 systems. This attribute type
-
GetVolumeInformation() will tell you if the driver is NTFS. GetFileSecurity() can also tell you, if it fails you're not on NTFS and will get the "Security Information" if this is what you mean by extended. GetFileAttributes() works on basic FAT r/w/h/s attributes. GetFileAttributesEx() gets a few more attributes. GetFileInformationByHandle() gets a bunch of crap. Or are you talking about "extended attributes" as in: Extended Attribute Information Used by file servers that are linked with OS/2 systems. This attribute type isn't useful to Windows NT. Extended Attributes Used by file servers that are linked with OS/2 systems. This attribute type
Thanks for the info! I have found that NTFS does not support extended attributes in the sense that OS/2 does (unfortunately, in my opinion). However, it does support multiple data streams. Normally, the default (unnamed) data stream is accessed. I can use a named data stream to achieve my purpose, though I have to jump through a few hoops. Thanks for the feedback!