

def main():
    import sys
    from ntfs.volume import FlatVolume
    from ntfs.BinaryParser import Mmap
    from ntfs.mft.MFT import MFTEnumerator
    logging.basicConfig(level=logging.DEBUG)
    with Mmap(sys.argv[1]) as buf:
        v = FlatVolume(buf, int(sys.argv[2]))
        fs = NTFSFilesystem(v)
        root = fs.get_root_directory()
        g_logger.info('root dir: %s', root)
        for c in root.get_children():
            g_logger.info('  - %s', c.get_name())
        sys32 = root.get_path_entry('windows\\system32')
        g_logger.info('sys32: %s', sys32)

dataset/ETHPy150Open williballenthin/python-ntfs/ntfs/filesystem/__init__.py main/original