I store opened files in a map: HashMap<u32, File>. Sometimes functions read_to_file and write_to_file are called. They get the file from the map and make the corresponding procedure. In order to avoid conflicts in writing and reading from the same file, I need to close the file. How can I do it?