implemented write and added file_list to thread.h