js_read(3)

NAME
js_read - Read data from an open file

SYNOPSIS
#include JsStr.h

int js_read(js_file *desc, js_string *js, int count)

DESCRIPTION
js_read is a function that reads data from an open file, and places the data in a js_string object.

ARGUMENTS
desc is a pointer to a file object opened for writing.

js is a pointer to a js_string object that we will place the read contents in.

count is the number of octets we read from the open file. Note that this is the number of octets, and does not take in to account the unit size of the js_string object js.

RETURN VALUE
js_read returns the number of octets read on success, and JS_ERROR if an error occured.

EXAMPLE
The following reads 100 bytes from the file "filename":

	js_string *foo;
	js_file *bar;
	foo = js_create(256,1);
	js_str2js(foo,"filename",8,1);
	js_open_read(foo,bar);
	js_read(bar,foo,100); /* Clobbering the contents of foo */

AUTHOR
Sam Trenholme <kiwi-zttfryb@koala.samiam.org>