Use backwards-compatible File syntax

The `File.write` appears to be a newer introduction. Just open the file
per usual before writing to it.