#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);
client OSfilesystem library
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.
- f
- The file to open.
- flags
- The open flags.
- out_openfile
- The oskit_openfile COM interface.
Returns 0 on success, or an error code specified in <oskit/error.h>, on error.