vfs_dir_ops Struct Reference

Operations on open directories. More...

Detailed Description

Operations on open directories.

Definition at line 448 of file vfs.h.

#include <vfs.h>

Data Fields

int(* opendir )(vfs_DIR *dirp, const char *dirname, const char *abs_path)
 Open a directory for reading with readdir. More...
 
int(* readdir )(vfs_DIR *dirp, vfs_dirent_t *entry)
 Read a single entry from the open directory dirp and advance the read position by one. More...
 
int(* closedir )(vfs_DIR *dirp)
 Close an open directory. More...
 

Field Documentation

◆ closedir

int(* vfs_dir_ops::closedir) (vfs_DIR *dirp)

Close an open directory.

Parameters
[in]dirppointer to open directory
Returns
0 on success
<0 on error, the directory stream dirp should be considered invalid

Definition at line 490 of file vfs.h.

◆ opendir

int(* vfs_dir_ops::opendir) (vfs_DIR *dirp, const char *dirname, const char *abs_path)

Open a directory for reading with readdir.

Parameters
[in]dirppointer to open directory
[in]namenull-terminated name of the dir to open, relative to the file system root, including a leading slash
[in]abs_pathnull-terminated name of the dir to open, relative to the VFS root ("/")
Returns
0 on success
<0 on error

Definition at line 459 of file vfs.h.

◆ readdir

int(* vfs_dir_ops::readdir) (vfs_DIR *dirp, vfs_dirent_t *entry)

Read a single entry from the open directory dirp and advance the read position by one.

entry will be populated with information about the next entry in the directory stream dirp

If entry was updated successfully, readdir shall return 1.

If the end of stream was reached, readdir shall return 0 and entry shall remain untouched.

Parameters
[in]dirppointer to open directory
[out]entrydirectory entry information
Returns
1 if entry was updated
0 if dirp has reached the end of the directory index
<0 on error

Definition at line 480 of file vfs.h.


The documentation for this struct was generated from the following file: