support writing a file