libzypp  17.30.0 File Reference
#include <zypp/PathInfo.h>
#include <zypp/base/StrMatcher.h>
#include <utime.h>
#include <sys/statvfs.h>
#include <sys/sysmacros.h>
#include <iostream>
#include <fstream>
#include <iomanip>
#include <zypp-core/fs/PathInfo.h>
#include <zypp-core/base/LogTools.h>
#include <zypp-core/base/String.h>
#include <zypp-core/base/IOStream.h>
#include <zypp-core/base/Errno.h>
#include <zypp-core/AutoDispose.h>
#include <zypp-core/ExternalProgram.h>
#include <zypp-core/Digest.h>
#include <zypp-core/fs/TmpPath.h>
Include dependency graph for

Go to the source code of this file.


 Easy-to use interface to the ZYPP dependency resolver.
 Types and functions for filesystem operations.


#define EMUMOUT(T)   case T: return str << #T; break
#define logResult   MIL << endl, doLogResult


const StrMatcher & zypp::filesystem::matchNoDots ()
 Convenience returning StrMatcher( "[^.]*", Match::GLOB ) More...
int zypp::filesystem::dirForEach (const Pathname &dir_r, const StrMatcher &matcher_r, function< bool(const Pathname &, const char *const)> fnc_r)
std::ostream & zypp::filesystem::operator<< (std::ostream &str, FileType obj)
std::ostream & zypp::filesystem::operator<< (std::ostream &str, const StatMode &obj)
std::ostream & zypp::filesystem::operator<< (std::ostream &str, const PathInfo &obj)
static int zypp::filesystem::recursive_rmdir_1 (const Pathname &dir, bool removeDir=true)
template<typename F >
int zypp::filesystem::dirForEachImpl (const Pathname &dir_r, F &&fnc_r)
Directory related functions.
int zypp::filesystem::mkdir (const Pathname &path, unsigned mode=0755)
 Like 'mkdir'. More...
int zypp::filesystem::assert_dir (const Pathname &path, unsigned mode=0755)
 Like 'mkdir -p'. More...
int zypp::filesystem::rmdir (const Pathname &path)
 Like 'rmdir'. More...
int zypp::filesystem::recursive_rmdir (const Pathname &path)
 Like 'rm -r DIR'. More...
int zypp::filesystem::clean_dir (const Pathname &path)
 Like 'rm -r DIR/ *'. More...
int zypp::filesystem::copy_dir (const Pathname &srcpath, const Pathname &destpath)
 Like 'cp -a srcpath destpath'. More...
int zypp::filesystem::copy_dir_content (const Pathname &srcpath, const Pathname &destpath)
 Like 'cp -a srcpath/. More...
int zypp::filesystem::dirForEach (const Pathname &dir_r, function< bool(const Pathname &, const char *const)> fnc_r)
 Invoke callback function fnc_r for each entry in directory dir_r. More...
int zypp::filesystem::dirForEachExt (const Pathname &dir_r, const function< bool(const Pathname &, const DirEntry &)> &fnc_r)
 Simiar to. More...
int zypp::filesystem::readdir (std::list< std::string > &retlist, const Pathname &path, bool dots=true)
 Return content of directory via retlist. More...
int zypp::filesystem::readdir (std::list< Pathname > &retlist, const Pathname &path, bool dots=true)
 Return content of directory via retlist. More...
int zypp::filesystem::readdir (DirContent &retlist, const Pathname &path, bool dots=true, PathInfo::Mode statmode=PathInfo::STAT)
 Return content of directory via retlist. More...
std::ostream & zypp::filesystem::operator<< (std::ostream &str, const DirContent &obj)
int zypp::filesystem::is_empty_dir (const Pathname &path)
 Check if the specified directory is empty. More...
File related functions.
int zypp::filesystem::unlink (const Pathname &path)
 Like 'unlink'. More...
int zypp::filesystem::rename (const Pathname &oldpath, const Pathname &newpath)
 Like 'rename'. More...
int zypp::filesystem::exchange (const Pathname &lpath, const Pathname &rpath)
 Exchanges two files or directories. More...
int zypp::filesystem::copy (const Pathname &file, const Pathname &dest)
 Like 'cp file dest'. More...
int zypp::filesystem::symlink (const Pathname &oldpath, const Pathname &newpath)
 Like 'symlink'. More...
int zypp::filesystem::hardlink (const Pathname &oldpath, const Pathname &newpath)
 Like '::link'. More...
int zypp::filesystem::hardlinkCopy (const Pathname &oldpath, const Pathname &newpath)
 Create newpath as hardlink or copy of oldpath. More...
int zypp::filesystem::readlink (const Pathname &symlink_r, Pathname &target_r)
 Like 'readlink'. More...
Pathname zypp::filesystem::expandlink (const Pathname &path_r)
 Recursively follows the symlink pointed to by path_r and returns the Pathname to the real file or directory pointed to by the link. More...
int zypp::filesystem::copy_file2dir (const Pathname &file, const Pathname &dest)
 Like 'cp file dest'. More...
int zypp::filesystem::assert_file (const Pathname &path, unsigned mode=0644)
 Create an empty file if it does not yet exist. More...
int zypp::filesystem::assert_file_mode (const Pathname &path, unsigned mode=0644)
 Like assert_file but enforce mode even if the file already exists. More...
int zypp::filesystem::touch (const Pathname &path)
 Change file's modification and access times. More...
Digest computaion.
check cooperation with zypp::Digest
std::string zypp::filesystem::md5sum (const Pathname &file)
 Compute a files md5sum. More...
std::string zypp::filesystem::sha1sum (const Pathname &file)
 Compute a files sha1sum. More...
std::string zypp::filesystem::checksum (const Pathname &file, const std::string &algorithm)
 Compute a files checksum. More...
bool zypp::filesystem::is_checksum (const Pathname &file, const CheckSum &checksum)
 check files checksum More...
int zypp::filesystem::erase (const Pathname &path)
 Erase whatever happens to be located at path (file or directory). More...
ZIP_TYPE zypp::filesystem::zipType (const Pathname &file)
ByteCount zypp::filesystem::df (const Pathname &path)
 Report free disk space on a mounted file system. More...
mode_t zypp::filesystem::getUmask ()
 Get the current umask (file mode creation mask) More...
Changing permissions.
int zypp::filesystem::chmod (const Pathname &path, mode_t mode)
 Like 'chmod'. More...
int zypp::filesystem::addmod (const Pathname &path, mode_t mode)
 Add the mode bits to the file given by path. More...
int zypp::filesystem::delmod (const Pathname &path, mode_t mode)
 Remove the mode bits from the file given by path. More...


template<class... T>
constexpr bool zypp::filesystem::always_false = false

Macro Definition Documentation


#define EMUMOUT (   T)    case T: return str << #T; break

◆ logResult

#define logResult   MIL << endl, doLogResult

Definition at line 284 of file