I'm starting to tinker with gawk's dynamic extensions, and I'm wanting to implement a preprocessor for the files that awk will be operating on. Specifically, I'm wanting to unzip gzipped files when they are passed as arguments to gawk. E.g. the invocation would be like:
awk -f myscript.awk file1.gz file2.gz file3.gz
And myscript.awk would call a dynamic extension somehow to preprocess each input file and decompress it before feeding the contents into awk's pattern-action statements. Are dynamic extensions capable of such preprocessing? What would it look like?
Later on, I would like to create a similar extension that would decode files, decrypt files, etc. before passing into awk. For these tasks I would usually preprocess the files and then pipe into awk or similar, but there are always disadvantages. It seems if dynamic extensions can preprocess files, I should be able to avoid the disadvantages.