#include <fs.h>
Public Types | |
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 |
enum | filetype { type_unknown } |
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 117 of file fs.h.
|
|
|
Definition at line 154 of file fs.h. Referenced by gid(). |
|
Definition at line 148 of file fs.h. Referenced by inode(). |
|
Definition at line 150 of file fs.h. Referenced by get_major(). |
|
Definition at line 151 of file fs.h. Referenced by get_minor(). |
|
Definition at line 147 of file fs.h. Referenced by mode(). |
|
Definition at line 152 of file fs.h. Referenced by num_links(). |
|
Definition at line 155 of file fs.h. Referenced by blocks(), blocksize(), and size(). |
|
Definition at line 156 of file fs.h. Referenced by last_access_time(), last_modification_time(), and last_status_change_time(). |
|
Definition at line 153 of file fs.h. Referenced by uid(). |
|
Definition at line 120 of file fs.h. Referenced by type(). |
|
C'tor.
|
|
C'tor.
Definition at line 763 of file fs.cc. References path(). |
Here is the call graph for this function:
|
D'tor.
|
|
Return the number of blocks used to store this file.
Definition at line 988 of file fs.cc. References m_stat, estring::size_type, and size_type. |
|
Return the blocksize used to store this file.
Definition at line 978 of file fs.cc. References m_stat, estring::size_type, and size_type. |
|
Clear all values.
Definition at line 1262 of file fs.cc. References m_gidfound, m_gname, m_major, m_minor, m_path, m_stat, m_uidfound, m_uname, and TRY_nomem. Referenced by path(). |
|
Return the file's device.
Definition at line 908 of file fs.cc. References device_type, and m_stat. |
|
If the pathname is a special file, return it's major number.
Definition at line 920 of file fs.cc. References m_major, and major_type. |
|
If the pathname is a special file, return it's minor number.
Definition at line 926 of file fs.cc. References m_minor, and minor_type. |
|
Return the file's owner's GID.
|
|
If the file's owner's GID is found in the passwd file, return true.
Definition at line 1004 of file fs.cc. References m_gidfound. |
|
Return the file's owner's group name (from UID).
Definition at line 1016 of file fs.cc. References m_gname. |
|
Return the file inode.
Definition at line 902 of file fs.cc. References inode_type, and m_stat. |
|
Return the last access time of this file.
|
|
Return the last modification time of this file.
|
|
Return the last status change time of this file.
|
|
If the pathname is a link, return the path it is linked to.
Definition at line 890 of file fs.cc. References m_link. Referenced by test_mk_relative_symlink(), and test_mk_symlink(). |
|
Return the file mode.
|
|
Return the number of links to this file.
Definition at line 932 of file fs.cc. References m_stat, and num_links_type. |
|
Return the pathname that this filestatus object has information about.
Definition at line 838 of file fs.cc. References m_path. Referenced by filestatus(). |
|
Retrieve information about a pathname.
Definition at line 774 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 directory::path(), subdirectory::path(), rm_recursive(), test_filestatus(), test_mk_relative_symlink(), and test_mk_symlink(). |
Here is the call graph for this function:
|
Return the file's raw device.
Definition at line 914 of file fs.cc. References device_type, and m_stat. |
|
Return the file size in bytes.
Definition at line 950 of file fs.cc. References m_stat, estring::size_type, and size_type. Referenced by test_filestatus(). |
|
Return the type of file.
|
|
Return the file's owner's UID.
|
|
If the file's owner's UID is found in the passwd file, return true.
Definition at line 998 of file fs.cc. References m_uidfound. |
|
Return the file's owner's user name (from UID).
Definition at line 1010 of file fs.cc. References m_uname. |
|
Definition at line 258 of file fs.h. Referenced by clear(), gid_is_found(), and path(). |
|
Definition at line 260 of file fs.h. Referenced by clear(), gid_name(), and path(). |
|
|
|
Definition at line 255 of file fs.h. Referenced by clear(), get_major(), and path(). |
|
Definition at line 256 of file fs.h. Referenced by clear(), get_minor(), and path(). |
|
|
|
Definition at line 253 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(). |
|
Definition at line 257 of file fs.h. Referenced by clear(), path(), and uid_is_found(). |
|
Definition at line 259 of file fs.h. Referenced by clear(), path(), and uid_name(). |