finished test when_write_file.c