Writing files to file system