created file_write_func