zypp::filesystem::TmpDir Class Reference

#include <TmpPath.h>

Inheritance diagram for zypp::filesystem::TmpDir:
[legend]

List of all members.

Public Member Functions

 TmpDir (const Pathname &inParentDir_r=defaultLocation(), const std::string &prefix_r=defaultPrefix())
 Ctor.

Static Public Member Functions

static TmpDir makeSibling (const Pathname &sibling_r)
 Provide a new empty temporary directory as sibling.
static const
std::string & 
defaultPrefix ()
 
Returns:
The default prefix for temporary directories (TmpDir.


Detailed Description

Provide a new empty temporary directory and recursively delete it when no longer needed.

The temporary directory is per default created in '/var/tmp' and named 'TmpDir.XXXXXX', with XXXXXX replaced by a string which makes the name unique. Different location and file prefix may be passed to the ctor. TmpDir is created with mode 0700.

The directory where the temporary directory is to be created must exist. TmpDir provides the Pathname of the temporary directory , or an empty path in case of any error.

Definition at line 161 of file TmpPath.h.


Constructor & Destructor Documentation

zypp::filesystem::TmpDir::TmpDir ( const Pathname inParentDir_r = defaultLocation(),
const std::string &  prefix_r = defaultPrefix() 
) [explicit]

Ctor.

Takes a Pathname.

Definition at line 244 of file TmpPath.cc.

References zypp::filesystem::TmpPath::_impl, zypp::filesystem::Pathname::asString(), ERR, zypp::filesystem::PathInfo::isDir(), and zypp::str::strerror().


Member Function Documentation

TmpDir zypp::filesystem::TmpDir::makeSibling ( const Pathname sibling_r  )  [static]

Provide a new empty temporary directory as sibling.

   TmpDir s = makeSibling( "/var/lib/mydir" );
   // returns: /var/lib/mydir.XXXXXX
If sibling_r exists, sibling is created using the same mode.

Definition at line 279 of file TmpPath.cc.

References zypp::filesystem::Pathname::basename(), zypp::filesystem::chmod(), and zypp::filesystem::Pathname::dirname().

Referenced by zypp::RepoManager::checkIfToRefreshMetadata(), and zypp::RepoManager::refreshMetadata().

const std::string & zypp::filesystem::TmpDir::defaultPrefix (  )  [static]

Returns:
The default prefix for temporary directories (TmpDir.

)

Definition at line 297 of file TmpPath.cc.


The documentation for this class was generated from the following files:
Generated on Tue Sep 25 19:23:20 2007 for libzypp by  doxygen 1.5.3