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

In reply to Re: How to remove COMPRESSED attribute with Win32::File? by lostjimmy
in thread How to remove COMPRESSED attribute with Win32::File? by NovasTaylor

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.