NAME

binary - query whether a File was opened with a binary mode

SYNOPSIS

file.binary()

DESCRIPTION

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)
print yes no
say yes no
write no yes

RETURN VALUE

Bool indicating whether a File was opened with a binary mode

ERRORS

TypeCheck if file is not a File
AccessCheck if file has been closed

EXAMPLE

        f = new File("foo.bin", "wb")
        f.binary()
    true

SEE ALSO

new File