Win32 SetAttributesでは、圧縮属性を変更できない

はまったのでメモ。

Win32のAPIである、SetAttributesではNTFSの圧縮属性を変更できない。
私は、PerlのWin32::File::SetAttributesを使って、圧縮属性を変更しようとしたができなかった。しかも、エラーとならずに成功する。
ということは、互換性のために残ったのか?と思ったが、どうやら逆。

Windowsの人には常識かもしれないけど、私のようにWindowsプログラミング初心者の人は注意。

.NETのことだけど、
FileAttributes.Compressed cannot be applied using File.SetAttributes or FileInfo.Attributes or DirectoryInfo.Attributes