should flush the written data before calling `putFile` that tries to read it back from the filesystem