updating oE get_integer16


include io.e 
namespace io 
public function get_integer16(integer fh) 

reads the next two bytes from a file and returns them as a single integer.

  1. fh : an integer, the handle to an open file to read from.

An integer, made of the bytes that could be read from the file. When an end of file is encountered, it returns -1.

  • This function is normally used with files opened in binary mode, "rb".
Example 1:
integer fn 
fn = open("temp", "rb")  -- an existing file 
atom file_type_code 
file_type_code = get_integer16(fn) 
See Also:

getc, gets, get_bytes, get_dstring

Not Categorized, Please Help


Quick Links

User menu

Not signed in.

Misc Menu