binary - query whether a File was opened with a binary mode
file.binary()
Returns true if the new
File() call specified a mode that included 'b', and
false otherwise. Binary-mode files and text-mode
files allow different operations:
| I/O intrinsic | Text-mode | Binary-mode |
|---|---|---|
| getchar | yes | yes |
| putchar | yes | yes |
| ungetc | yes | yes |
| readstr | yes | yes |
| read | yes (formatted) | yes (unformatted) |
| yes | no | |
| say | yes | no |
| write | no | yes |
Bool indicating whether a File was opened with
a binary mode
TypeCheck if file is not a
File
AccessCheck if
file has been closed
f = new File("foo.bin", "wb")
f.binary()
true