libzypp 17.31.23
zypp::media::Mount Class Reference

Interface to the mount program. More...

#include </home/abuild/rpmbuild/BUILD/libzypp-17.31.23/zypp-media/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.
 
static time_t getMTime ()
 Get the modification time of the /etc/mtab file.
 

Detailed Description

Interface to the mount program.

Definition at line 74 of file mount.h.

Member Typedef Documentation

◆ Environment

For passing additional environment variables to mount.

Definition at line 82 of file mount.h.

◆ Options

Mount options.

'key' or 'key=value' pairs, separated by ','

Definition at line 87 of file mount.h.

Constructor & Destructor Documentation

◆ Mount()

zypp::media::Mount::Mount ( )

Create an new instance.

Definition at line 56 of file mount.cc.

◆ ~Mount()

zypp::media::Mount::~Mount ( )

Clean up.

Definition at line 59 of file mount.cc.

Member Function Documentation

◆ 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

Parameters
sourcewhat to mount (e.g. /dev/hda3)
targetwhere to mount (e.g. /mnt)
filesystemwhich filesystem to use (e.g. reiserfs) (-t parameter)
optionsmount options (e.g. ro) (-o parameter)
environmentoptinal environment to pass (e.g. PASSWD="sennah")
Exceptions
MediaException

Definition at line 62 of file mount.cc.

◆ umount()

void zypp::media::Mount::umount ( const std::string &  path)

umount device

Parameters
pathdevice or mountpoint to umount
Exceptions
MediaException

Definition at line 117 of file mount.cc.

◆ getEntries()

MountEntries zypp::media::Mount::getEntries ( const std::string &  mtab = "")
static

Return mount entries from /etc/mtab or /etc/fstab file.

Parameters
mtabThe 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 read /proc/mounts and /etc/mtab in case is not a symlink to /proc/mounts.
Returns
A vector with mount entries or empty vector if reading or parsing of the mtab file(s) failed.

Definition at line 169 of file mount.cc.

◆ getMTime()

time_t zypp::media::Mount::getMTime ( )
static

Get the modification time of the /etc/mtab file.

Returns
Modification time of the /etc/mtab file.

Definition at line 264 of file mount.cc.


The documentation for this class was generated from the following files: