Hello.
I am trying to make a folder compressed and failing miserably. Below
are three ways that I tried to make it compressed, all of them compile
and run w/o any problems, but the folder is still not-compressed.
(using NTFS, win2k)
// some folder
string path = @"C:\TEMP\";
// try #1
File.SetAttributes(path, FileAttributes.Compressed);
// try #2
File.SetAttributes(path, File.GetAttributes(path) |
FileAttributes.Compressed);
// try #3
DirectoryInfo di = new DirectoryInfo(path);
di.Attributes = di.Attributes | FileAttributes.Compressed;
What am I doing wrong?
(I did not work before with the FlagsAttribute enums, so I could be
doing something completely wrong, but I tried to find how to do it, and
those seem to be the proper ways)
Thanks,
Pavel