L4Re - L4 Runtime Environment
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)=0 throw ()
 Check access permissions on the given file. More...
 
virtual int mkdir (const char *path, mode_t mode)=0 throw ()
 Create a new subdirectory. More...
 
virtual int unlink (const char *path)=0 throw ()
 Unlink the given file from that directory. More...
 
virtual int rename (const char *src_path, const char *dst_path)=0 throw ()
 Rename the given file. More...
 
virtual int link (const char *src_path, const char *dst_path)=0 throw ()
 Create a hard link (second name) for the given file. More...
 
virtual int symlink (const char *src_path, const char *dst_path)=0 throw ()
 Create a symbolic link for the given file. More...
 
virtual int rmdir (const char *path)=0 throw ()
 Delete an empty directory. More...
 

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 use always the combined L4Re::Vfs::File interface.

Definition at line 141 of file vfs.h.

Member Function Documentation

◆ faccessat()

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

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 
)
throw (
)
pure virtual

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

Backend for the POSIX link and linkat functions.

Parameters
src_pathThe old name to 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 
)
throw (
)
pure virtual

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 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 
)
throw (
)
pure virtual

Rename the given file.

Backend for the POSIX rename, renameat functions.

Parameters
src_pathThe old name to 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)
throw (
)
pure virtual

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 
)
throw (
)
pure virtual

Create a symbolic link for the given file.

Backend for the POSIX symlink and symlinkat functions.

Parameters
src_pathThe old name to 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)
throw (
)
pure virtual

Unlink the given file from that directory.

Backend for the POSIX unlink and unlinkat functions.

Parameters
pathThe name to 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: