Is there any way to flush latex's file io buffers. Because of something I'm trying to achieve I have to copy/modify the outputted pdf after it is created(but in the same compile run). The problem is, it seems, that the pdf is not fully flushed before I copy/modify it. The result is a partially copied file which end up corrupt.
Is there any way to get tex/latex/lutex/lualatex to flush the buffers before I do the copy? (the copy is in lualatex and happens right after the pdf is generated. It is not done separately)