BOOTSTRAP (kutils) functions


LIBRARY ROUTINE

kreadfile - read the contents of a file into a data array

LIBRARY CALL

kaddr kreadfile(
   const char *filename,
   size_t     *num_read)

INPUT

OUTPUT

RETURN VALUE

returns a pointer to the contents of the file or NULL upon failure

DESCRIPTION

This routine opens the specified and using the khoros transport mechanisms reads the contents of the file into an array. An optional "num_read" can be used to find out the actual number of bytes read. If "num_read" is NULL then the parameter is ignored.

ADDITIONAL INFORMATION

none

EXAMPLES

none

SIDE EFFECTS

the data returned is allocated and needs to freed using kfree_and_NULL().

RESTRICTIONS

none

MODIFICATION

none

FILES

$BOOTSTRAP/objects/library/kutils/src/file.c

SEE ALSO

kutils(3)

COPYRIGHT

Copyright (C) 1993 - 1997, Khoral Research, Inc. ("KRI") All rights reserved.