MPD 0.20.6

- Main Page
- Namespaces
- Data Structures
- Files

- File List
- Globals

Functions
FileSystem.hxx File Reference
`#include "check.h"`
`#include "Traits.hxx"`
`#include "system/fd_util.h"`
`#include "Path.hxx"`
`#include <sys/stat.h>`
`#include <unistd.h>`
`#include <stdio.h>`
Include dependency graph for FileSystem.hxx:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Functions
static FILE * | FOpen (Path file, PathTraitsFS::const_pointer_type mode)
| Wrapper for fopen() that uses Path names. More...
static int | OpenFile (Path file, int flags, int mode)
| Wrapper for open_cloexec() that uses Path names. More...
void | RenameFile (Path oldpath, Path newpath)
static bool | StatFile (Path file, struct stat &buf, bool follow_symlinks=true)
| Wrapper for stat() that uses Path names. More...
void | TruncateFile (Path path)
| Truncate a file that exists already. More...
void | RemoveFile (Path path)
| Wrapper for unlink() that uses Path names. More...
AllocatedPath | ReadLink (Path path)
| Wrapper for readlink() that uses Path names. More...
static bool | MakeFifo (Path path, mode_t mode)
static bool | CheckAccess (Path path, int mode)
| Wrapper for access() that uses Path names. More...
static bool | FileExists (Path path, bool follow_symlinks=true)
| Checks if Path exists and is a regular file. More...
static bool | DirectoryExists (Path path, bool follow_symlinks=true)
| Checks if Path exists and is a directory. More...
static bool | PathExists (Path path)
| Checks if Path exists. More...

## Function Documentation

static bool CheckAccess | ( | Path | path,
|  | int | mode
| ) |  |
| inline static

Wrapper for access() that uses Path names.

Definition at line 122 of file FileSystem.hxx.

static bool DirectoryExists | ( | Path | path,
|  | bool | follow_symlinks = `true`
| ) |  |
| inline static

Checks if Path exists and is a directory.

Definition at line 151 of file FileSystem.hxx.

static bool FileExists | ( | Path | path,
|  | bool | follow_symlinks = `true`
| ) |  |
| inline static

Checks if Path exists and is a regular file.

Definition at line 133 of file FileSystem.hxx.

static FILE* FOpen | ( | Path | file,
|  | PathTraitsFS::const_pointer_type | mode
| ) |  |
| inline static

Wrapper for fopen() that uses Path names.

Definition at line 44 of file FileSystem.hxx.

static bool MakeFifo | ( | Path | path,
|  | mode_t | mode
| ) |  |
| inline static

Definition at line 113 of file FileSystem.hxx.

static int OpenFile | ( | Path | file,
|  | int | flags,
|  | int | mode
| ) |  |
| inline static

Wrapper for open_cloexec() that uses Path names.

Definition at line 57 of file FileSystem.hxx.

static bool PathExists | ( | Path | path | ) |
| inline static

Checks if Path exists.

Definition at line 168 of file FileSystem.hxx.

AllocatedPath ReadLink | ( | Path | path | ) |

Wrapper for readlink() that uses Path names.

void RemoveFile | ( | Path | path | ) |

Wrapper for unlink() that uses Path names.

Throws std::system_error on error.

void RenameFile | ( | Path | oldpath,
|  | Path | newpath
| ) |  |

static bool StatFile | ( | Path | file,
|  | struct stat & | buf,
|  | bool | follow_symlinks = `true`
| ) |  |
| inline static

Wrapper for stat() that uses Path names.

Definition at line 80 of file FileSystem.hxx.

void TruncateFile | ( | Path | path | ) |

Truncate a file that exists already.

Throws std::system_error on error.