|
AquilaOS documentation
How it works, and its code
|
Reading a directory's entries, and finding one by name. More...
Go to the source code of this file.
Functions | |
| ssize_t | vfs_readdir (struct vnode *dir, off_t off, struct dirent *dirent) |
| Reads a directory's entry at an offset. | |
| int | vfs_finddir (struct vnode *dir, const char *name, struct dirent *dirent) |
| Finds the entry of a directory that has a name. | |
| int | vfs_dir_empty (struct vnode *dir) |
| Says whether a directory is empty, so that it can be removed. | |
Reading a directory's entries, and finding one by name.
Definition in file readdir.c.
| int vfs_dir_empty | ( | struct vnode * | dir | ) |
Says whether a directory is empty, so that it can be removed.
An empty directory has no entries besides . and ...
| dir | the directory |
Definition at line 69 of file readdir.c.
References vfs_dir_empty(), and vfs_readdir().
Referenced by vfs_dir_empty(), vfs_remove(), and vfs_rename().
| int vfs_finddir | ( | struct vnode * | dir, |
| const char * | name, | ||
| struct dirent * | dirent ) |
Finds the entry of a directory that has a name.
| dir | the directory |
| name | the name |
| dirent | the entry, filled in |
Definition at line 46 of file readdir.c.
References vops::finddir, vnode::fs, LOG_DEBUG, vnode::mode, vfs_finddir(), and fs::vops.
Referenced by entry_get(), entry_name(), lookup_name(), vfs_finddir(), vfs_lookup_parent(), vfs_parent(), and vfs_remove().
Reads a directory's entry at an offset.
Offsets count entries, starting at 0.
| dir | the directory |
| off | which entry |
| dirent | the entry, filled in |
Definition at line 19 of file readdir.c.
References vnode::fs, LOG_DEBUG, vnode::mode, vops::readdir, vfs_readdir(), and fs::vops.
Referenced by entry_name(), posix_file_readdir(), vfs_dir_empty(), and vfs_readdir().