next up previous contents index
Next: 22.4.2 fsread_FSTYPE_open: Open a Up: 22.4 API reference Previous: 22.4 API reference

22.4.1 fsread_open: Open a file on various filesystems

 

SYNOPSIS

#include <oskit/fs/read.h>

oskit_error_t fsread_open(oskit_blkio_t *device, const char *path, [out] oskit_blkio_t **out_file);

DESCRIPTION

Tries to open a file named by path in the filesystem on device. If successful, returns a blkio into out_file that can be used to read the file.

This function is just a wrapper that calls the various filesystem-specific fsread functions, failing if none of them recognize the filesystem.

PARAMETERS

device
An oskit_blkio_t (Section 5.3) representing a device containing a filesystem.
path
A pathname indicating an existing file to open. This pathname is taken relative to the root of the filesystem
out_file
Upon success, this is set to an oskit_blkio_t that can be used to read from the file.

RETURNS

Returns 0 on success, or an error code specified in <oskit/error.h>, on error.



University of Utah Flux Research Group