Understanding the main() function

This function is more complicated than our typical main() function and starts to parse the WAL file rather than act as a controller for the script. In this function, we will perform file validation, parse the WAL file header, identify the number of frames in the file, and call the function to process those frames:

055 def main(wal_file, output_dir, **kwargs):056     """057     The main function parses the header of the input file and058     identifies the WAL file. It then splits the file into the059     appropriate frames and send them for processing. After060     processing, if applicable, the regular expression modules are061     ran. Finally the raw data output is written to a CSV file.062 :param wal_file: The filepath to the ...

Get Learning Python for Forensics - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.