3 ms·
Both, ADS and xattrs are extremely useful. Let's say you need to associate some metadata with a file, but you can't change its contents' format. You could use s
by cryptonector 8y ago
Both, ADS and xattrs are extremely useful. Let's say you need to associate some metadata with a file, but you can't change its contents' format. You could use some separate file that goes with it, but now you can't atomically rename(2) the thing... But with ADS/xattrs you just attach those to the file, and then when you rename(2) the file the ADS/xattrs go with it atomically. (Yes, you could rename a directory, but it doesn't quite have the same semantics as renaming a file. In particular, rename(2) of a directory won't rm -rf the target if it exists.)
POSIX-ish systems that support ADS use openat(2), not open(2) naming conventions, to get at ADS. POSIX-ish systems that support xattrs use other system calls specifically for that purpose. It's NOT ADS that causes these problems but the naming conventions used to make them accessible without having to write programs that use new system calls instead of open(2) (POSIX) or CreateFile() (WIN32).