test two modes of operation in terms of tmp_filename, remove all possible memory allocations that are not necessary, write a total of 100 files