#include <fs.h>
Public Types | |
enum | filetype { type_unknown } |
typedef mode_t | mode_type |
typedef ino_t | inode_type |
typedef dev_t | device_type |
typedef uint32 | major_type |
typedef uint32 | minor_type |
typedef nlink_t | num_links_type |
typedef uid_t | uid_type |
typedef gid_t | gid_type |
typedef uint64 | size_type |
typedef time_t | time_type |
Public Member Functions | |
filestatus () | |
C'tor. | |
filestatus (const std::string a_path) | |
C'tor. | |
~filestatus () | |
D'tor. | |
void | path (const std::string a_path) |
Retrieve information about a pathname. | |
const std::string | path (void) const |
Return the pathname that this filestatus object has information about. | |
const filetype | type (void) const |
Return the type of file. | |
const std::string | link (void) const |
If the pathname is a link, return the path it is linked to. | |
const mode_type | mode (void) const |
Return the file mode. | |
const inode_type | inode (void) const |
Return the file inode. | |
const device_type | dev (void) const |
Return the file's device. | |
const device_type | rdev (void) const |
Return the file's raw device. | |
const major_type | get_major (void) const |
If the pathname is a special file, return it's major number. | |
const minor_type | get_minor (void) const |
If the pathname is a special file, return it's minor number. | |
const num_links_type | num_links (void) const |
Return the number of links to this file. | |
const uid_type | uid (void) const |
Return the file's owner's UID. | |
const gid_type | gid (void) const |
Return the file's owner's GID. | |
const size_type | size (void) const |
Return the file size in bytes. | |
const time_type | last_access_time (void) const |
Return the last access time of this file. | |
const time_type | last_modification_time (void) const |
Return the last modification time of this file. | |
const time_type | last_status_change_time (void) const |
Return the last status change time of this file. | |
const size_type | blocksize (void) const |
Return the blocksize used to store this file. | |
const size_type | blocks (void) const |
Return the number of blocks used to store this file. | |
const bool | uid_is_found (void) const |
If the file's owner's UID is found in the passwd file, return true. | |
const bool | gid_is_found (void) const |
If the file's owner's GID is found in the passwd file, return true. | |
const std::string | uid_name (void) const |
Return the file's owner's user name (from UID). | |
const std::string | gid_name (void) const |
Return the file's owner's group name (from UID). | |
void | clear (void) |
Clear all values. | |
Private Attributes | |
std::string | m_path |
stat | m_stat |
std::string | m_link |
major_type | m_major |
minor_type | m_minor |
bool | m_uidfound |
bool | m_gidfound |
std::string | m_uname |
std::string | m_gname |
Definition at line 120 of file fs.h.
typedef mode_t filestatus::mode_type |
typedef ino_t filestatus::inode_type |
typedef dev_t filestatus::device_type |
typedef uint32 filestatus::major_type |
typedef uint32 filestatus::minor_type |
typedef nlink_t filestatus::num_links_type |
typedef uid_t filestatus::uid_type |
typedef gid_t filestatus::gid_type |
typedef uint64 filestatus::size_type |
typedef time_t filestatus::time_type |
enum filestatus::filetype |
filestatus::filestatus | ( | const std::string | a_path | ) |
void filestatus::path | ( | const std::string | a_path | ) |
Retrieve information about a pathname.
Definition at line 818 of file fs.cc.
References clear(), ERROR, m_gidfound, m_gname, m_link, m_major, m_minor, m_path, m_stat, m_uidfound, m_uname, reform_path(), and TRY_nomem.
Referenced by configuration_manager::check(), global_parser::parse_rsync_local_path(), global_parser::parse_vault(), directory::path(), subdirectory::path(), rm_recursive(), test_filestatus(), test_inodes(), test_mk_relative_symlink(), and test_mk_symlink().
Here is the call graph for this function:
const std::string filestatus::path | ( | void | ) | const |
Return the pathname that this filestatus object has information about.
Definition at line 882 of file fs.cc.
References m_path.
Referenced by filestatus().
const filestatus::filetype filestatus::type | ( | void | ) | const |
const std::string filestatus::link | ( | void | ) | const |
If the pathname is a link, return the path it is linked to.
Definition at line 934 of file fs.cc.
References m_link.
Referenced by test_mk_relative_symlink(), and test_mk_symlink().
const filestatus::mode_type filestatus::mode | ( | void | ) | const |
const filestatus::inode_type filestatus::inode | ( | void | ) | const |
Return the file inode.
Definition at line 946 of file fs.cc.
References m_stat.
Referenced by test_inodes().
const filestatus::device_type filestatus::dev | ( | void | ) | const |
const filestatus::device_type filestatus::rdev | ( | void | ) | const |
const filestatus::major_type filestatus::get_major | ( | void | ) | const |
const filestatus::minor_type filestatus::get_minor | ( | void | ) | const |
const filestatus::num_links_type filestatus::num_links | ( | void | ) | const |
const filestatus::uid_type filestatus::uid | ( | void | ) | const |
const filestatus::gid_type filestatus::gid | ( | void | ) | const |
const filestatus::size_type filestatus::size | ( | void | ) | const |
Return the file size in bytes.
Definition at line 994 of file fs.cc.
References m_stat.
Referenced by test_filestatus().
const filestatus::time_type filestatus::last_access_time | ( | void | ) | const |
const filestatus::time_type filestatus::last_modification_time | ( | void | ) | const |
const filestatus::time_type filestatus::last_status_change_time | ( | void | ) | const |
const filestatus::size_type filestatus::blocksize | ( | void | ) | const |
const filestatus::size_type filestatus::blocks | ( | void | ) | const |
const bool filestatus::uid_is_found | ( | void | ) | const |
If the file's owner's UID is found in the passwd file, return true.
Definition at line 1042 of file fs.cc.
References m_uidfound.
const bool filestatus::gid_is_found | ( | void | ) | const |
If the file's owner's GID is found in the passwd file, return true.
Definition at line 1048 of file fs.cc.
References m_gidfound.
const std::string filestatus::uid_name | ( | void | ) | const |
const std::string filestatus::gid_name | ( | void | ) | const |
void filestatus::clear | ( | void | ) |
std::string filestatus::m_path [private] |
struct stat filestatus::m_stat [private] |
Definition at line 256 of file fs.h.
Referenced by blocks(), blocksize(), clear(), dev(), gid(), inode(), last_access_time(), last_modification_time(), last_status_change_time(), mode(), num_links(), path(), rdev(), size(), type(), and uid().
std::string filestatus::m_link [private] |
major_type filestatus::m_major [private] |
minor_type filestatus::m_minor [private] |
bool filestatus::m_uidfound [private] |
bool filestatus::m_gidfound [private] |
std::string filestatus::m_uname [private] |
std::string filestatus::m_gname [private] |