other versions
- wheezy 3.01.00-1+b1
- jessie 3.23.01-1
- testing 4.04.00-1
- unstable 4.04.00-1
- experimental 4.07.00-1
other sections
FBB::Stat(3bobcat) | Characteristics of object in the filesystem | FBB::Stat(3bobcat) |
NAME¶
FBB::Stat - Determines File CharacteristicsSYNOPSIS¶
#include <bobcat/stat>DESCRIPTION¶
Stat is a wrapper around the stat(2) system function. In particular, it offers features to test directly for object characteristics offered by stat(2). To determine whether an object exists the Stat bool conversion operator can be used.NAMESPACE¶
FBBINHERITS FROM¶
-ENUMERATIONS¶
Stat::Combine:- o
- ALL: require all of the specified Mode or SpecialMode values to match;
- o
- ANY: require any match of the specified Mode
or SpecialMode values (one match suffices);
- o
- UR: the owner of the object has read permissions
- o
- UW: the owner of the object has write permissions
- o
- UX: the owner of the object has execute permissions
- o
- GR: the group to which the object belongs has read permissions
- o
- GW: the group to which the object belongs has write permissions
- o
- GX: the group to which the object belongs has execute permissions
- o
- OR: others have read permissions
- o
- OW: others have write permissions
- o
- OX: others have execute permissions
- o
- RWX: all of the above.
- o
- SUID: set UID bit is up
- o
- SGID: set GID bit is up
- o
- SB: sticky bit is up
- o
- BLOCK_DEVICE: the object represents a block device
- o
- CHARACTER_DEVICE: the object represents a character device
- o
- DIRECTORY: the object represents a directory
- o
- FIFO: the object represents a named pipe (a queue)
- o
- REGULAR_FILE: the object represents a regular file
- o
- SOCKET: the object represents a socket
- o
- SYMBOLIC_LINK: the object represents a symbolic link
CONSTRUCTORS¶
- o
- Stat():
- o
- Stat(std::string const &fname):
- o
- Stat(std::string const &fname, std::string const
&searchPath):
OVERLOADED OPERATORS¶
- o
- operator bool() const:
MEMBER FUNCTIONS¶
- o
- size_t blockSize() const:
- o
- size_t device() const:
- o
- size_t deviceType() const:
- o
- size_t error() const:
- o
- bool isType(Stat::Type probe):
- o
- size_t inode() const:
- o
- size_t gid() const:
- o
- FBB::DateTime lastAccess() const:
- o
- FBB::DateTime lastChange() const:
- o
- FBB::DateTime lastModification() const:
- o
- size_t mode() const:
- o
- bool mode(size_t mode, Combine combine = ALL):
- o
- std::string modeStr() const:
- o
- std::string const &name() const:
- o
- size_t nBlocks() const:
- o
- size_t nLinks() const:
- o
- std::string path() const:
- o
- bool set(std::string const &name):
- o
- bool set(std::string const &name, std::string const
&pathlist):
- o
- off_t size() const:
- o
- bool specialMode(size_t special, Combine combine =
ALL):
- o
- Stat::stat const &statStruct() const:
- o
- Stat::Type type() const:
- o
- std::string typeStr() const:
- o
- size_t uid() const:
EXAMPLE¶
/* driver.cc */ #include <iostream> #include <string> #include <bobcat/stat> #include <bobcat/datetime> using namespace std; using namespace FBB; int main(int argc, char **argv) { if (argc == 1) { cout << "Usage: driver object [colon-separated searchpath]\n"; return 1; } Stat st; if (argc == 2) st.set(argv[1]); else if (argc == 3) st.set(argv[1], argv[2]); if (!st) { cout << "Can’t stat " << argv[1] << ", errno = " << st.error() << endl; return 1; } cout << st.name() << ": access: " << st.lastAccess() << "\n" << st.name() << ": change: " << st.lastChange() << "\n" << st.name() << ": modif: " << st.lastModification() << "\n" "Mode: " << oct << st.mode() << " (" << st.modeStr() << ")\n" "Type: " << st.type() << " (" << st.typeStr() << ")\n" "Full path: " << st.path() << endl; return 0; }
FILES¶
bobcat/stat - defines the class interfaceSEE ALSO¶
bobcat(7), stat(3)BUGS¶
None Reported.DISTRIBUTION FILES¶
- o
- bobcat_3.01.00-x.dsc: detached signature;
- o
- bobcat_3.01.00-x.tar.gz: source archive;
- o
- bobcat_3.01.00-x_i386.changes: change log;
- o
- libbobcat1_3.01.00-x_*.deb: debian package holding the libraries;
- o
- libbobcat1-dev_3.01.00-x_*.deb: debian package holding the libraries, headers and manual pages;
- o
- http://sourceforge.net/projects/bobcat: public
archive location;
BOBCAT¶
Bobcat is an acronym of `Brokken’s Own Base Classes And Templates’.COPYRIGHT¶
This is free software, distributed under the terms of the GNU General Public License (GPL).AUTHOR¶
Frank B. Brokken ( f.b.brokken@rug.nl).2005-2012 | libbobcat1-dev_3.01.00-x.tar.gz |