Interestingly, you can get this on Windows if you have ActivePerl installed, using the Win32::File module.

The catch (apart from the fact that you'd like to do this from Linux) is that Win32::File doesn't seem to have a constant for "ENCRYPTED", but it does return the correct bit set...

grep FILE_ATTRIBUTE_ENCRYPTED *\*.h Include/WinNT.h:#define FILE_ATTRIBUTE_ENCRYPTED 0x00004000
And running GetAttributes on an encrypted file yields:
C:\>perl -MWin32::File -e"Win32::File::GetAttributes('README.TXT',$x); + printf qq(%X\n),$x;map {printf qq(%-10s %08X\n),$_,&{'Win32::File::'.$_}} qw +(ARCHIVE C OMPRESSED DIRECTORY HIDDEN NORMAL OFFLINE READONLY SYSTEM TEMPORARY)" 6021 ARCHIVE 00000020 COMPRESSED 00000800 DIRECTORY 00000010 HIDDEN 00000002 NORMAL 00000080 OFFLINE 00001000 READONLY 00000001 SYSTEM 00000004 TEMPORARY 00000100
I realize that doesn't really help you from Linux, unless you set up an "isencrypted_d" service running on NT :)

If you're curious, the 0x2000 bit is "FILE_ATTRIBUTE_NOT_CONTENT_INDEXED"...
--
Mike


In reply to Re: Re: Re: Detecting Encrypted Files in a mounted Windows FS? by RMGir
in thread Detecting Encrypted Files in a mounted Windows FS? by traveler

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.