next up previous contents index
Next: 20.1.5 mount: Mount a Up: 20.1 Introduction Previous: 20.1.3 chcwd: Set the

20.1.4 lookup: Translate a multi component path to a directory or file object

 

SYNOPSIS

#include <oskit/fs/fsnamespace.h>

oskit_error_t oskit_fsnamespace_lookup(oskit_fsnamespace_t *f, const char *pathname, int flags, [out] oskit_file_t **out_file);

DESCRIPTION

Translate a multi component pathname (ie: one with slashes) into an oskit_file COM object. The root and current working directories for the pathname translation are a function of the filesystem namespace object (See the chroot and chcwd interface methods). Pathname lookup is subject to certain flags. They are:

FSLOOKUP_FOLLOW
Follow symlinks when translating the final component of a pathname. This is the default operation. Note that when translating symlinks, the ``last'' component refers to whatever the current last component is. If the last component is a multi componet symlink, that new path will be followed until its last component. If the new last component is again a symlink, it will be followed (or not followed) according to the same flag.

FSLOOKUP_NOFOLLOW
Do not follow symlinks when translating the final component of a pathname. Instead, return the oskit_file COM object of the symlink itself. For example, the lstat system call uses this option to that it can operate on the symlink itself, rather than the target of the symlink.

FSLOOKUP_PARENT
Instead of returning the oskit_file COM object of the translated pathname, return the COM object of the parent directory instead. The translation is subject to the same rules as any other translation; the file in question must exist in order to return its parent.

PARAMETERS

f
The OSKit filesysem namespace interface object.
pathname
The pathname to be translated.
flags
Flags to modify the translation operation.
out_file
The oskit_file COM interface for the file.

RETURNS

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


next up previous contents index
Next: 20.1.5 mount: Mount a Up: 20.1 Introduction Previous: 20.1.3 chcwd: Set the

Utah Flux Research Group