next up previous contents index
Next: 7.4.6 getfs: Get the Up: 7.4 oskit_file: File Interface Previous: 7.4.4 readlink: Read the

7.4.5 open: Create an open instance of this file

   

SYNOPSIS

#include <oskit/fs/file.h>
#include <oskit/fs/openfile.h>

oskit_error_t oskit_file_open(oskit_file_t *f, oskit_oflags_t flags, [out] oskit_openfile_t **out_openfile);

DIRECTION

client OS tex2html_wrap_inline32841 filesystem library

DESCRIPTION

This method returns an oskit_openfile COM interface for an open instance of this file. flags specifies the file open flags, as defined in <oskit/fs/file.h>. If OSKIT_O_TRUNC is specified, then the file will be truncated to zero length.

This method may only be used on regular files and directories. Directories may not be opened with OSKIT_O_WRONLY, OSKIT_O_RDWR or OSKIT_O_TRUNC.

This method may return success but set *out_openfile to NULL, indicating that the requested operation is allowed but the filesystem does not support per-open state; the client operating system must provide this functionality.

PARAMETERS

f
The file to open.
flags
The open flags.
out_openfile
The oskit_openfile COM interface.

RETURNS

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



University of Utah Flux Research Group