Implement write_files feature