#include <TmpPath.h>
Public Member Functions | |
TmpFile (const Pathname &inParentDir_r=defaultLocation(), const std::string &prefix_r=defaultPrefix()) | |
Ctor. | |
Static Public Member Functions | |
static TmpFile | makeSibling (const Pathname &sibling_r) |
Provide a new empty temporary directory as sibling. | |
static const std::string & | defaultPrefix () |
The temporary file is per default created in '/var/tmp' and named 'TmpFile.XXXXXX', with XXXXXX replaced by a string which makes the name unique. Different location and file prefix may be passed to the ctor. TmpFile is created with mode 0600.
TmpFile provides the Pathname of the temporary file, or an empty path in case of any error.
Definition at line 115 of file TmpPath.h.
zypp::filesystem::TmpFile::TmpFile | ( | const Pathname & | inParentDir_r = defaultLocation() , |
|
const std::string & | prefix_r = defaultPrefix() | |||
) | [explicit] |
Ctor.
Takes a Pathname.
Definition at line 171 of file TmpPath.cc.
References zypp::filesystem::TmpPath::_impl, zypp::filesystem::assert_dir(), zypp::filesystem::Pathname::asString(), ERR, and zypp::str::strerror().
Provide a new empty temporary directory as sibling.
TmpFile s = makeSibling( "/var/lib/myfile" ); // returns: /var/lib/myfile.XXXXXX
sibling_r
exists, sibling is created using the same mode.
Definition at line 208 of file TmpPath.cc.
References zypp::filesystem::Pathname::basename(), zypp::filesystem::chmod(), and zypp::filesystem::Pathname::dirname().
Referenced by zypp::target::TargetImpl::buildCache(), zypp::filesystem::exchange(), zypp::target::SoftLocksFile::store(), zypp::target::RequestedLocalesFile::store(), and zypp::target::HardLocksFile::store().
const std::string & zypp::filesystem::TmpFile::defaultPrefix | ( | ) | [static] |
Definition at line 226 of file TmpPath.cc.