use less memory when just writing the filelist