fs_read_file

void *fs_read_file(const char *path, size_t *size)

Reads a whole file content.

int size;
void* buf;
if (!(buf = fs_read_file("foo.txt", &size)))
{
    printf("fs_read_file failed");
}
else
{
    printf("file size: %d", size);
}

Parameters
  • path[in] Some null-terminated path to existing file

  • size[out] Number of bytes read

Returns

A pointer to read bytes if there is no error, NULL otherwise.