L4Re Operating System Framework
Interface and Usage Documentation
Loading...
Searching...
No Matches
L4Re::Vfs::Directory Class Referenceabstract

Interface for a POSIX file that is a directory. More...

#include <vfs.h>

+ Inheritance diagram for L4Re::Vfs::Directory:
+ Collaboration diagram for L4Re::Vfs::Directory:

Public Member Functions

virtual int faccessat (const char *path, int mode, int flags) noexcept=0
 Check access permissions on the given file.
 
virtual int mkdir (const char *path, mode_t mode) noexcept=0
 Create a new subdirectory.
 
virtual int unlink (const char *path) noexcept=0
 Unlink the given file from that directory.
 
virtual int rename (const char *src_path, const char *dst_path) noexcept=0
 Rename the given file.
 
virtual int link (const char *src_path, const char *dst_path) noexcept=0
 Create a hard link (second name) for the given file.
 
virtual int symlink (const char *src_path, const char *dst_path) noexcept=0
 Create a symbolic link for the given file.
 
virtual int rmdir (const char *path) noexcept=0
 Delete an empty directory.
 

Detailed Description

Interface for a POSIX file that is a directory.

This interface provides functionality for directory files in the L4Re::Vfs. However, real objects always use the combined L4Re::Vfs::File interface.

Definition at line 140 of file vfs.h.

Member Function Documentation

◆ faccessat()

virtual int L4Re::Vfs::Directory::faccessat ( const char *  path,
int  mode,
int  flags 
)
pure virtualnoexcept

Check access permissions on the given file.

Backend function for POSIX access and faccessat functions.

Parameters
pathThe path relative to this directory. Note: path is relative to this directory and may contain subdirectories.
modeThe access mode to check.
flagsThe flags as in POSIX faccessat (AT_EACCESS, AT_SYMLINK_NOFOLLOW).
Returns
0 on success, or <0 on error.

Implemented in L4Re::Vfs::Be_file.

◆ link()

virtual int L4Re::Vfs::Directory::link ( const char *  src_path,
const char *  dst_path 
)
pure virtualnoexcept

Create a hard link (second name) for the given file.

Backend for the POSIX link and linkat functions.

Parameters
src_pathThe old name of the file. Note: src_path is relative to this directory and may contain subdirectories.
dst_pathThe new (second) name for the file. Note: dst_path is relative to this directory and may contain subdirectories.
Returns
0 on success, or <0 on error.

Implemented in L4Re::Vfs::Be_file.

◆ mkdir()

virtual int L4Re::Vfs::Directory::mkdir ( const char *  path,
mode_t  mode 
)
pure virtualnoexcept

Create a new subdirectory.

Backend for POSIX mkdir and mkdirat function calls.

Parameters
pathThe name of the subdirectory to create. Note: path is relative to this directory and may contain subdirectories.
modeThe file mode to use for the new directory.
Returns
0 on success, or <0 on error. -ENOTDIR if this or some component in path is not a directory.

Implemented in L4Re::Vfs::Be_file.

◆ rename()

virtual int L4Re::Vfs::Directory::rename ( const char *  src_path,
const char *  dst_path 
)
pure virtualnoexcept

Rename the given file.

Backend for the POSIX rename, renameat functions.

Parameters
src_pathThe old name of the file to rename. Note: src_path is relative to this directory and may contain subdirectories.
dst_pathThe new name for the file. Note: dst_path is relative to this directory and may contain subdirectories.
Returns
0 on success, or <0 on error.

Implemented in L4Re::Vfs::Be_file.

◆ rmdir()

virtual int L4Re::Vfs::Directory::rmdir ( const char *  path)
pure virtualnoexcept

Delete an empty directory.

Backend for POSIX rmdir, rmdirat functions.

Parameters
pathThe name of the directory to remove. Note: path is relative to this directory and may contain subdirectories.
Returns
0 on success, or <0 on error.

Implemented in L4Re::Vfs::Be_file.

◆ symlink()

virtual int L4Re::Vfs::Directory::symlink ( const char *  src_path,
const char *  dst_path 
)
pure virtualnoexcept

Create a symbolic link for the given file.

Backend for the POSIX symlink and symlinkat functions.

Parameters
src_pathThe old name of the file. Note: src_path shall be an absolute path.
dst_pathThe name for symlink. Note: dst_path is relative to this directory and may contain subdirectories.
Returns
0 on success, or <0 on error.

Implemented in L4Re::Vfs::Be_file.

◆ unlink()

virtual int L4Re::Vfs::Directory::unlink ( const char *  path)
pure virtualnoexcept

Unlink the given file from that directory.

Backend for the POSIX unlink and unlinkat functions.

Parameters
pathThe name of the file to unlink. Note: path is relative to this directory and may contain subdirectories.
Returns
0 on success, or <0 on error.

Implemented in L4Re::Vfs::Be_file.


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