Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Assuming you are using ntfs-3g to mount your NTFS partitions on linux (this is default on most current linux distributions).</p> <p>You will need to read file extended attributes (see <a href="http://linux.die.net/man/5/attr">attr(5)</a>), you can use <a href="http://pyxattr.sourceforge.net/">pyxattr</a> for this. NTFS attributes are stored in <code>system.ntfs_attrib</code> extended attribute as a set of flags which values are documented in <a href="http://www.tuxera.com/community/ntfs-3g-advanced/extended-attributes/">ntfs-3g documentation</a>.</p> <p>Here is a sample code to read and decode NTFS file system attributes and use them to filter files:</p> <pre><code>import os, struct, xattr # values from http://www.tuxera.com/community/ntfs-3g-advanced/extended-attributes/ attributes = ['readonly', 'hidden', 'system', 'unknown', 'unknown', 'archive', 'unknown', 'unknown', 'temp', 'unknown', 'unknown', 'compressed_dir', 'offline', 'not_content_indexed' ] + ['unknown']*18 def ntfs_attr(path): attr = struct.unpack("i", xattr.get(path, "system.ntfs_attrib"))[0] for shift, attribute in enumerate(attributes): if (attr &gt;&gt; shift) &amp; 1 == 1: yield attribute def main(): import sys if len(sys.argv) != 3: print "Usage: %s path attribute" % sys.argv[0] a = set(attributes) a.remove('unknown') print "where attribute is one of:", ' '.join(a) sys.exit(1) path = sys.argv[1] attribute = sys.argv[2] print "Files with %s attribute in %s:" % (attribute, path) for filename in os.listdir(path): fullname = os.path.join(path, filename) if attribute in ntfs_attr(fullname): print fullname if __name__ == '__main__': main() </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload