Port make_dummy_files to Python3 and improve it in various ways.