Write/read files (Updated).