Windows supports a file system concept called “extended attributes”. The basic idea is quite reasonable: any application can attach data to a file without modifying the file itself (as long as it has permission to meddle with extended attributes). Each application can add its own special data without interfering with other applications. Not all file systems support this: NTFS does, FAT32 doesn’t.
At the driver level, you receive perfectly reasonable-looking requests with codes like IRP_MJ_QUERY_EA and IRP_MJ_SET_EA to manipulate them, or get them passed in at file creation time. Update: The kernel does have NtQueryEaFile() and NtSetEaFile() as undocumented APIs.
At the user level, if you want to write a reliable, runs-everywhere application, you get at them through the backup API. If you’re on a sufficiently advanced version of Windows and you know that the file system implements EAs as “streams” (a special feature of NTFS), you can use the new stream control API to manipulate EAs. But nowhere is there a straightforward way to manipulate these things the way they’re designed to be used. It’s like a filing cabinet where you have to remove the entire drawer in order to use it, even though you know perfectly well you should be able to grab the individual folders.
Microsoft Windows Hatred Status
|Their developers are smoking advanced experimental prototype monkey crack again.|