File.h
Go to the documentation of this file.
void error(char *format,...)
FileOpeningConfig & locked(unsigned int attempts=5)
protect concurrent accesses by attempting to obtain an appropriate lock
Definition: File.cc:82
FileOpeningConfig & createdIfMissing()
when opening a file for writing, create it if it does not exist
Definition: File.cc:90
FileOpeningConfig & openedByRoot()
enter_suid() to open the file; leaves suid ASAP after that
Definition: File.h:34
File(const File &)=delete
void lock(const FileOpeningConfig &cfg)
calls lockOnce() as many times as necessary (including zero)
Definition: File.cc:321
static File * Optional(const SBuf &aName, const FileOpeningConfig &cfg)
Definition: File.cc:124
File & operator=(const File &)=delete
void lockOnce(const FileOpeningConfig &cfg)
locks, blocking or returning immediately depending on the lock waiting mode
Definition: File.cc:342
SBuf sysCallError(const char *callName, const int savedErrno) const
Definition: File.cc:372
SBuf sysCallFailure(const char *callName, const SBuf &error) const
Definition: File.cc:365
SBuf readSmall(SBuf::size_type minBytes, SBuf::size_type maxBytes)
read(2) for small files
Definition: File.cc:241