Write to a file, read when it's done