I suspect that xattr would be better in general, and would hopefully have fewer races.
Thanks for the prompt review; it's much appreciated. I'll rework this to use xattr instead. I think I misinterpreted your initial direction as looking for something with more widely guaranteed support.
I hadn't checked before, but it's worth mentioning that one limitation of xattr, which could be potentially problematic, is the allowed size of xattr. From `man 7 xattr` on Linux:
In the current ext2, ext3, and ext4 filesystem implementations, the total bytes used by the names and values of all of a file's extended attributes must fit in a single filesystem block (1024, 2048 or 4096 bytes, depending on the block size specified when the filesystem was created).
That's the most restrictive limit given, but that's also by far the most common file system. By contrast, Windows places the limit for reparse data at 16 kB [1]. The Unix limit would also include xattr used for other purposes: DOS attributes (fortunately very small) and ACLs (which we don't implement yet but will need to later). Fortunately we don't have to worry about EAs since Microsoft forbids having EAs on a reparse point [not that a use case has been found for EAs yet.]
In practice this is probably going to be fine, but it's something to be aware of.
[1] https://learn.microsoft.com/en-us/windows/win32/fileio/reparse-points
Note that since these are stored in the filesystem, you also have to consider races caused by other tools manipulating the files.
I regrettably don't understand what this actually implies. File system races are an odd concept because I can't imagine any case that would *not* be user error. Fortunately I suppose it doesn't matter because xattr should be just as atomic as reparse points are...
Also there are still quite a few test failures on Windows from the previous rounds of tests, it would be prudent to address that first.
Sorry, I didn't notice these. They don't show up in the CI and the testbot no longer warns about them anywhere visible :-/ I'll fix them first.