in reply to How to remove COMPRESSED attribute with Win32::File?
And just in case you want a bit of explanation...
In order to clear a bit, you must first negate the bit mask, then bitwise AND it with the attribute flags. So the negation flips the bits, which makes it all ones, except for the bit we want to clear. This way when you AND it with the flags, the only bit affected is the one we want to clear.
That was wordy and probably confusing. I guess that's what I get for posting at 2:00am. How about an example?
#These values probably don't match the actual values COMPRESSED = 0001 0000 $attr = 0101 1100 After negation = 1110 1111 &0101 1100 ---------- 0100 1100
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to remove COMPRESSED attribute with Win32::File?
by NovasTaylor (Initiate) on Mar 06, 2009 at 03:29 UTC | |
by ikegami (Patriarch) on Mar 06, 2009 at 04:18 UTC | |
by syphilis (Archbishop) on Mar 06, 2009 at 04:49 UTC |