#include <Mount.h>
Public Types | |
typedef ExternalProgram::Environment | Environment |
For passing additional environment variables to mount. | |
typedef KVMap < kvmap::KVMapBase::CharSep<'=',','> > | Options |
Mount options. | |
Public Member Functions | |
Mount () | |
Create an new instance. | |
~Mount () | |
Clean up. | |
void | mount (const std::string &source, const std::string &target, const std::string &filesystem, const std::string &options, const Environment &environment=Environment()) |
mount device | |
void | umount (const std::string &path) |
umount device | |
Static Public Member Functions | |
static MountEntries | getEntries (const std::string &mtab="") |
Return mount entries from /etc/mtab or /etc/fstab file. | |
Private Member Functions | |
void | run (const char *const *argv, const Environment &environment, ExternalProgram::Stderr_Disposition stderr_disp=ExternalProgram::Stderr_To_Stdout) |
Run mount with the specified arguments and handle stderr. | |
void | run (const char *const *argv, ExternalProgram::Stderr_Disposition stderr_disp=ExternalProgram::Stderr_To_Stdout) |
int | Status () |
Return the exit status of the process, closing the connection if not already done. | |
void | Kill () |
Forcably kill the process. | |
Private Attributes | |
ExternalProgram * | process |
The connection to the mount process. | |
int | exit_code |
The exit code of the process, or -1 if not yet known. |
Definition at line 69 of file Mount.h.
typedef KVMap<kvmap::KVMapBase::CharSep<'=',','> > zypp::media::Mount::Options |
zypp::media::Mount::Mount | ( | ) |
zypp::media::Mount::~Mount | ( | ) |
void zypp::media::Mount::mount | ( | const std::string & | source, | |
const std::string & | target, | |||
const std::string & | filesystem, | |||
const std::string & | options, | |||
const Environment & | environment = Environment() | |||
) |
mount device
source | what to mount (e.g. /dev/hda3) | |
target | where to mount (e.g. /mnt) | |
filesystem | which filesystem to use (e.g. reiserfs) (-t parameter) | |
options | mount options (e.g. ro) (-o parameter) | |
environment | optinal environment to pass (e.g. PASSWD="sennah") |
MediaException |
Definition at line 64 of file Mount.cc.
References DBG, MIL, process, zypp::externalprogram::ExternalDataSource::receiveLine(), run(), Status(), zypp::ExternalProgram::Stderr_To_Stdout, WAR, and ZYPP_THROW.
Referenced by zypp::media::MediaNFS::attachTo(), zypp::media::MediaISO::attachTo(), zypp::media::MediaDISK::attachTo(), zypp::media::MediaCIFS::attachTo(), and zypp::media::MediaCD::attachTo().
void zypp::media::Mount::umount | ( | const std::string & | path | ) |
umount device
path | device or mountpoint to umount |
MediaException |
Definition at line 160 of file Mount.cc.
References DBG, MIL, process, zypp::externalprogram::ExternalDataSource::receiveLine(), run(), Status(), zypp::ExternalProgram::Stderr_To_Stdout, WAR, and ZYPP_THROW.
Referenced by zypp::media::MediaNFS::attachTo(), zypp::media::MediaISO::attachTo(), zypp::media::MediaDISK::attachTo(), zypp::media::MediaCIFS::attachTo(), zypp::media::MediaCD::attachTo(), zypp::media::MediaHandler::forceRelaseAllMedia(), zypp::media::MediaNFS::releaseFrom(), zypp::media::MediaISO::releaseFrom(), zypp::media::MediaDISK::releaseFrom(), zypp::media::MediaCIFS::releaseFrom(), and zypp::media::MediaCD::releaseFrom().
MountEntries zypp::media::Mount::getEntries | ( | const std::string & | mtab = "" |
) | [static] |
Return mount entries from /etc/mtab or /etc/fstab file.
mtab | The name of the (mounted) file system description file to read from. This file should be one /etc/mtab, /etc/fstab or /proc/mounts. Default is to try the /etc/mtab and fail back to /proc/mounts. |
Definition at line 273 of file Mount.cc.
References DBG, zypp::str::strerror(), and WAR.
Referenced by zypp::media::MediaManager_Impl::getMountEntries().
void zypp::media::Mount::run | ( | const char *const * | argv, | |
const Environment & | environment, | |||
ExternalProgram::Stderr_Disposition | stderr_disp = ExternalProgram::Stderr_To_Stdout | |||
) | [private] |
void zypp::media::Mount::run | ( | const char *const * | argv, | |
ExternalProgram::Stderr_Disposition | stderr_disp = ExternalProgram::Stderr_To_Stdout | |||
) | [inline, private] |
int zypp::media::Mount::Status | ( | ) | [private] |
Return the exit status of the process, closing the connection if not already done.
Definition at line 250 of file Mount.cc.
References zypp::ExternalProgram::close(), DBG, exit_code, zypp::ExternalProgram::kill(), and process.
void zypp::media::Mount::Kill | ( | ) | [private] |
Forcably kill the process.
Definition at line 266 of file Mount.cc.
References zypp::ExternalProgram::kill(), and process.
ExternalProgram* zypp::media::Mount::process [private] |
int zypp::media::Mount::exit_code [private] |