<s> from MFT import MFTEnumerator <EOL> import mmap <EOL> import logging <EOL> import calendar <EOL> from datetime import datetime <EOL> import argparse <EOL> from MFT import Cache <EOL> from MFT import MFTTree <EOL> class Mmap ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , filename ) : <EOL> super ( Mmap , self ) . __init__ ( ) <EOL> self . _filename = filename <EOL> self . _f = None <EOL> self . _mmap = None <EOL> def __enter__ ( self ) : <EOL> self . _f = open ( self . _filename , "<STR_LIT:rb>" ) <EOL> self . _mmap = mmap . mmap ( self . _f . fileno ( ) , <NUM_LIT:0> , access = mmap . ACCESS_READ ) <EOL> return self . _mmap <EOL> def __exit__ ( self , type , value , traceback ) : <EOL> self . _mmap . close ( ) <EOL> self . _f . close ( ) <EOL> def main ( ) : <EOL> parser = argparse . ArgumentParser ( description = '<STR_LIT>' <EOL> '<STR_LIT>' ) <EOL> parser . add_argument ( '<STR_LIT:-c>' , action = "<STR_LIT:store>" , metavar = "<STR_LIT>" , type = int , <EOL> dest = "<STR_LIT>" , default = <NUM_LIT> , <EOL> help = "<STR_LIT>" ) <EOL> parser . add_argument ( '<STR_LIT>' , action = "<STR_LIT:store_true>" , dest = "<STR_LIT>" , <EOL> help = "<STR_LIT>" ) <EOL> parser . add_argument ( '<STR_LIT:filename>' , action = "<STR_LIT:store>" , <EOL> help = "<STR_LIT>" ) <EOL> results = parser . parse_args ( ) <EOL> if results . verbose : <EOL> logging . basicConfig ( level = logging . DEBUG ) <EOL> with Mmap ( results . filename ) as buf : <EOL> record_cache = Cache ( results . cache_size ) <EOL> path_cache = Cache ( results . cache_size ) <EOL> tree = MFTTree ( buf ) <EOL> tree . build ( record_cache = record_cache , path_cache = path_cache ) <EOL> def rec ( node , prefix ) : <EOL> print prefix + node . get_filename ( ) <EOL> for child in node . get_children ( ) : <EOL> rec ( child , prefix + "<STR_LIT:U+0020>" ) <EOL> rec ( tree . get_root ( ) , "<STR_LIT>" ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> main ( ) </s>
