With this capability in mind, it is possible for write to automatically change modes based on its argument. For example, we can detect a binary type and force the write to be binary.
Using the contents of the above example to illustrate:
ofile: open %out
write ofile str
write ofile bin ; in /binary mode
The first part is written in string (text) mode with line conversions. The second part is written as binary, without conversions.
(And, of course we will continue to allow /binary to be used to always write as binary.)
If we decide to allow it, we will probably also support:
write %out bin ; uses /binary mode
The binary is written to the file without line conversion.