On Fri, Apr 8, 2022 at 8:23 AM Jérôme LAURENS <jerome.laurens@u-bourgogne.fr> wrote:
Sorry, last answer was too short…

The problem is not that the new pdf output is not complete until the end of the typesetting process, the problem is that the old pdf is removed at the beginning of the typesetting process, whereas it could be removed only at the very last moment. This would be a big improvement in everyone’s workflow (overleaf uses that de facto).

Ah ok, this is the  problem...well in this case the solution should be to open a tempfile to write the pdf data  and when finished rename the tempfile. 
No need for command line switches.
I cannot use a jobname-related name, because  the format can choose the same name to write its data: it has to be a tempfile name generated by the operating system, 
and also  it  must be deleted after  the termination of the program --  in any case, i.e error or abort -- because otherwise we can have tons of useless files that waste space.
I can look  at these kinds of requests because it can be an optimization -- something that does the same thing but better -- modulo that I have not to upset the  code too much.
Indeed, another constraint is that the source code of pdftex /xetex / luatex should be comparable.

--
luigi