updating oE get_dstring


include io.e 
namespace io 
public function get_dstring(integer fh, integer delim = 0) 

read a delimited byte string from an opened file.

  1. fh : an integer, the handle to an open file to read from.
  2. delim : an integer, the delimiter that marks the end of a byte string. If omitted, a zero is assumed.

An sequence, made of the bytes that could be read from the file.

  • If the end-of-file is found before the delimiter, the delimiter is appended to the returned string.
Example 1:
integer fn 
fn = open("temp", "rb")  -- an existing file 
sequence text 
text = get_dstring(fn)	-- Get a zero-delimited string 
text = get_dstring(fn, '$')	-- Get a '$'-delimited string 
See Also:

getc, gets, get_bytes, get_integer32

Not Categorized, Please Help


Quick Links

User menu

Not signed in.

Misc Menu