MPD  0.20.18
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

◆ CheckAccess()

static bool CheckAccess ( Path  path,
int  mode 
)
inlinestatic

Wrapper for access() that uses Path names.

Definition at line 122 of file FileSystem.hxx.

◆ DirectoryExists()

static bool DirectoryExists ( Path  path,
bool  follow_symlinks = true 
)
inlinestatic

Checks if Path exists and is a directory.

Definition at line 151 of file FileSystem.hxx.

◆ FileExists()

static bool FileExists ( Path  path,
bool  follow_symlinks = true 
)
inlinestatic

Checks if Path exists and is a regular file.

Definition at line 133 of file FileSystem.hxx.

◆ FOpen()

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

Wrapper for fopen() that uses Path names.

Definition at line 44 of file FileSystem.hxx.

◆ MakeFifo()

static bool MakeFifo ( Path  path,
mode_t  mode 
)
inlinestatic

Definition at line 113 of file FileSystem.hxx.

◆ OpenFile()

static int OpenFile ( Path  file,
int  flags,
int  mode 
)
inlinestatic

Wrapper for open_cloexec() that uses Path names.

Definition at line 57 of file FileSystem.hxx.

◆ PathExists()

static bool PathExists ( Path  path)
inlinestatic

Checks if Path exists.

Definition at line 168 of file FileSystem.hxx.

◆ ReadLink()

AllocatedPath ReadLink ( Path  path)

Wrapper for readlink() that uses Path names.

◆ RemoveFile()

void RemoveFile ( Path  path)

Wrapper for unlink() that uses Path names.

Throws std::system_error on error.

◆ RenameFile()

void RenameFile ( Path  oldpath,
Path  newpath 
)

◆ StatFile()

static bool StatFile ( Path  file,
struct stat &  buf,
bool  follow_symlinks = true 
)
inlinestatic

Wrapper for stat() that uses Path names.

Definition at line 80 of file FileSystem.hxx.

◆ TruncateFile()

void TruncateFile ( Path  path)

Truncate a file that exists already.

Throws std::system_error on error.