simple write file operation