`File` is not an output range. You have to use `File.lockingTextWriter` for that, which apparently deals with text.