tfel
Loading...
Searching...
No Matches
tfel::system::systemCall Struct Reference

#include </home/runner/work/tfel/tfel/include/TFEL/System/System.hxx>

Static Public Member Functions

static void throwSystemError (const std::string &, const int)
static void mkdir (const std::string &, const mode_t=S_IRWXU|S_IRWXG)
static void unlink (const std::string &)
static void rmdir (const std::string &)
static void write (const int, const void *const, size_t)
static void read (const int, void *const, size_t)
 read exactly the given number of bytes
static void copy (const std::string &, const std::string &)
static std::string getAbsolutePath (const std::string &)
static void changeCurrentWorkingDirectory (const std::string &)
static std::string getCurrentWorkingDirectory ()
static std::string getUserName ()
static std::string getHostName ()

Detailed Description

This structure contains C++ wrapping over many posix system call.

Member Function Documentation

◆ copy()

void tfel::system::systemCall::copy ( const std::string & ,
const std::string &  )
static

copy a file or a directory. This command is equivalent to the shell command 'cp -R'.

Parameters
[in]src.
[in]destination.

◆ getAbsolutePath()

std::string tfel::system::systemCall::getAbsolutePath ( const std::string & )
static
Returns
the absolute path of a file or a directory (this is a simple wrapper around ::realpath).
Parameters
[in]ffile name

◆ mkdir()

void tfel::system::systemCall::mkdir ( const std::string & ,
const mode_t = S_IRWXU|S_IRWXG )
static

create one or more directories. This command is equivalent to the shell command 'mkdir -p'.

Parameters
[in]pathto be created.
constmode_t, opening mode.

◆ read()

void tfel::system::systemCall::read ( const int ,
void * const ,
size_t  )
static

read exactly the given number of bytes

Exceptions
SystemErrorat the end of file

◆ rmdir()

void tfel::system::systemCall::rmdir ( const std::string & )
static
Parameters
d: directory to remove

◆ throwSystemError()

void tfel::system::systemCall::throwSystemError ( const std::string & ,
const int  )
static

An helper function to convert errno values to C++ exceptions.

Parameters
[in]adescription of the error.
constint, value of errno.

◆ unlink()

void tfel::system::systemCall::unlink ( const std::string & )
static
Parameters
f: file to unlink

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