Loading...
Searching...
No Matches
vfs_dir_ops Struct Reference

Operations on open directories. More...

Detailed Description

Operations on open directories.

Definition at line 578 of file vfs.h.

#include <vfs.h>

Data Fields

int(* opendir )(vfs_DIR *dirp, const char *dirname)
 Open a directory for reading with readdir.
 
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.
 
int(* closedir )(vfs_DIR *dirp)
 Close an open directory.
 

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 619 of file vfs.h.

◆ opendir

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

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
Returns
0 on success
<0 on error

Definition at line 588 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 609 of file vfs.h.


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