/usr/share/doc/libbobcat4-dev/man/stat.3.html is in libbobcat-dev 4.08.02-2build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 | <!DOCTYPE html><html><head>
<meta charset="UTF-8">
<title>FBB::Stat(3bobcat)</title>
<style type="text/css">
figure {text-align: center;}
img {vertical-align: center;}
.XXfc {margin-left:auto;margin-right:auto;}
.XXtc {text-align: center;}
.XXtl {text-align: left;}
.XXtr {text-align: right;}
.XXvt {vertical-align: top;}
.XXvb {vertical-align: bottom;}
</style>
<link rev="made" href="mailto:Frank B. Brokken: f.b.brokken@rug.nl">
</head>
<body text="#27408B" bgcolor="#FFFAF0">
<hr/>
<h1 id="title">FBB::Stat(3bobcat)</h1>
<h2 id="author">Characteristics of object in the filesystem<br/>(libbobcat-dev_4.08.02-x.tar.gz)</h2>
<h2 id="date">2005-2017</h2>
<p>
<h2 >NAME</h2>FBB::Stat - Determines File Characteristics
<p>
<h2 >SYNOPSIS</h2>
<strong >#include <bobcat/stat></strong><br/>
Linking option: <em >-lbobcat</em>
<p>
<h2 >DESCRIPTION</h2>
<strong >Stat</strong> is a wrapper around the <strong >stat</strong>(2) system function. In
particular, it offers features to test directly for object
characteristics offered by <strong >stat</strong>(2). To determine whether an object exists
the <em >Stat bool</em> conversion operator can be used.
<p>
<h2 >NAMESPACE</h2>
<strong >FBB</strong><br/>
All constructors, members, operators and manipulators, mentioned in this
man-page, are defined in the namespace <strong >FBB</strong>.
<p>
<h2 >INHERITS FROM</h2>
-
<p>
<h2 >ENUMERATIONS</h2>
<p>
<strong >Stat::Combine</strong>: <br/>
This enumeration defines the following values:
<ul>
<li> <strong >ALL</strong>: require all of the specified <strong >Mode</strong> or
<strong >SpecialMode</strong> values to match;
<li> <strong >ANY</strong>: require any match of the specified <strong >Mode</strong> or
<strong >SpecialMode</strong> values (one match suffices);
</ul>
<p>
<strong >Stat::Mode</strong>: <br/>
This enumeration defines the following values:
<ul>
<li> <strong >UR</strong>: the owner of the object has read permissions
<li> <strong >UW</strong>: the owner of the object has write permissions
<li> <strong >UX</strong>: the owner of the object has execute permissions
<li> <strong >GR</strong>: the group to which the object belongs has read permissions
<li> <strong >GW</strong>: the group to which the object belongs has write
permissions
<li> <strong >GX</strong>: the group to which the object belongs has execute
permissions
<li> <strong >OR</strong>: others have read permissions
<li> <strong >OW</strong>: others have write permissions
<li> <strong >OX</strong>: others have execute permissions
<li> <strong >READ</strong>: equal to <em >UR | GR | OR</em>
<li> <strong >WRITE</strong>: equal to <em >UW | GW | OW</em>
<li> <strong >EXEC</strong>: equal to <em >UX | GX | OX</em>
<li> <strong >RWX</strong>: all of the above.
</ul>
<p>
<strong >Stat::SpecialMode</strong>: <br/>
This enumeration defines the following values:
<ul>
<li> <strong >SUID</strong>: set UID bit is up
<li> <strong >SGID</strong>: set GID bit is up
<li> <strong >SB</strong>: sticky bit is up
</ul>
<p>
<strong >Stat::Type</strong>: <br/>
This enumeration, which is identical to the <strong >glob</strong>(3bobcat) <em >Type</em>
enumeration, defines the following values:
<ul>
<li> <strong >BLOCK_DEVICE</strong>: the object represents a block device
<li> <strong >CHARACTER_DEVICE</strong>: the object represents a character device
<li> <strong >DIRECTORY</strong>: the object represents a directory
<li> <strong >FIFO</strong>: the object represents a named pipe (a queue)
<li> <strong >REGULAR_FILE</strong>: the object represents a regular file
<li> <strong >SOCKET</strong>: the object represents a socket
<li> <strong >SYMBOLIC_LINK</strong>: the object represents a symbolic link
<li> <strong >ANY</strong>: any of the above types
</ul>
<p>
<h2 >CONSTRUCTORS</h2>
<ul>
<li> <strong >Stat()</strong>:<br/>
The default constructor, creating an empty <strong >Stat</strong> object.
<li> <strong >Stat(std::string const &fname)</strong>:<br/>
Initializes a <strong >Stat</strong> with a given object name.
<li> <strong >Stat(std::string const &fname, std::string const &searchPath)</strong>:<br/>
Initializes a <strong >Stat</strong> with a given object name, where the object is
searched in the <em >searchPath</em> directories, which is a colon-separated
string of directory names. The filenames are constructed by appending
<em >fname</em> to each of the elements of <em >searchPath</em> until an existing
object is found. This object is then used. If <em >fname</em> is an absolute
path, <em >searchPath</em> is ignored.
</ul>
The copy constructor is available.
<p>
<h2 >OVERLOADED OPERATORS</h2>
<ul>
<li> <strong >operator bool() const</strong>:<br/>
This operator returns <em >true</em> if the <em >Stat</em> object holds information
about an existing object. Otherwise <em >false</em> is returned.
</ul>
<p>
The default assignment operator is available.
<p>
<h2 >MEMBER FUNCTIONS</h2>
<ul>
<li> <strong >bool access(FBB::User const &user, size_t spec, bool useEffective =
true) const</strong>:<br/>
Returns <em >true</em> if <em >user</em> has the permissions as specified at
<em >spec</em> (of which only the defined <em >Mode</em> bits are interpreted). If
a combination of read, write and/or execute permissions are specified,
then at least one of the read permissions, one of the write
permissions and one of the execute permissions must be granted or the
function returns <em >false</em>. E.g, when specifying <em >access(user, UW |
UR | GR)</em> then the user <em >must</em> have write permissions, but either
the user or the user's group must have read permissions. If multiple
read, multiple write or multiple execute permissions are specified
(like <em >UR | GR</em>) then this member returns <em >true</em> if at least one
of the requested read, write, or execute permissions are granted for
<em >user</em>.
<li> <strong >size_t blockSize() const</strong>:<br/>
Returns the blocksize (<em >st_blksize</em>) for filesystem I/O
<li> <strong >size_t device() const</strong>:<br/>
Returns the device id (<em >st_dev</em>).
<li> <strong >size_t deviceType() const</strong>:<br/>
Returns the device type number, but only if the object type is
<strong >DEVICE</strong> (<em >st_rdev</em>).
<li> <strong >size_t error() const</strong>:<br/>
Returns the error number associated with an error, in cases where
<strong >operator bool()</strong> returns <strong >false</strong>. A returned value of 0 indicates
`no errors'.
<li> <strong >bool isType(Stat::Type probe)</strong>:<br/>
Returns <em >true</em> if the object has the probed type otherwise <em >false</em>
is returned.
<li> <strong >size_t inode() const</strong>:<br/>
Returns the inode number (<em >st_ino</em>).
<li> <strong >size_t gid() const</strong>:<br/>
Returns the group ID of the object's owner (<em >st_gid</em>).
<li> <strong >FBB::DateTime lastAccess() const</strong>:<br/>
Returns a <strong >FBB::DateTime</strong> object holding information about the
object's time of last access (<em >st_atime</em>) (using UTC).
<li> <strong >FBB::DateTime lastChange() const</strong>:<br/>
Returns a <strong >FBB::DateTime</strong> object holding information about the
object's time of last status change (<em >st_ctime</em>) (using UTC).
<li> <strong >FBB::DateTime lastModification() const</strong>:<br/>
Returns a <strong >FBB::DateTime</strong> object holding information about the
object's last modification time (<em >st_mtime</em>) (using UTC).
<li> <strong >size_t mode() const</strong>:<br/>
Returns the object's raw, uninterpreted mode (<em >st_mode & RWX</em>). Note
that this value is usually displayed (and is processed most easily) as
an octal value.
<li> <strong >bool mode(size_t mode, Combine combine = ALL)</strong>:<br/>
Returns true if the object has the indicated mode. Multiple modes may
be set, which can be combined by the logical <strong >bitor</strong> operator. By
default, if multiple modes are specified, the resulting pattern must
exactly represent the object's mode for the member function to return
<strong >true</strong>. An optional argument <em >ANY</em> may be specified if the
function should return true if at least one specified mode matches the
object's actual mode. An <em >Exception</em> exception is thrown if the
specified <em >mode</em> contains other values than the defined <strong >Mode</strong>
or <strong >SpecialMode</strong> values.
<li> <strong >std::string modeStr() const</strong>:<br/>
Returns the standard string-representation of the object's mode (e.g.,
<em >rw-r--r--</em>). Special modes (e.g., suid) are indicated by <em >s</em>
instead of <em >x</em> when the object is user and/or group executable and
by <em >S</em> if the object has the special mode bit(s) set, but is not
executable. For the `other' executable mode flag <em >t</em> is used
(`sticky' bit) and <em >T</em> if the object is not `other' executable.
<li> <strong >std::string const &name() const</strong>:<br/>
Returns the object's name as specified in the constructor or <strong >set()</strong>
member function.
<li> <strong >size_t nBlocks() const</strong>:<br/>
Returns the object's number of allocated blocks (<em >st_blocks</em>).
<li> <strong >size_t nLinks() const</strong>:<br/>
Returns the object's number of hard links (<em >st_nlink</em>).
<li> <strong >std::string path() const</strong>:<br/>
Returns the object's full pathname. If the full pathname could not be
determined, an empty string is returned.
<li> <strong >bool set(std::string const &name)</strong>:<br/>
Redefine the <strong >Stat</strong> object to represent the information about
the indicated object name.
<li> <strong >bool set(std::string const &name, std::string const &pathlist)</strong>:<br/>
Redefine the <strong >Stat</strong> object to represent the information about the
indicated object name, where the object is searched in the
<em >pathlist</em> directories, which is a colon-separated string of
directory names. The object names are constructed by appending
<em >fname</em> to each of the elements of <em >searchPath</em> until an existing
object is found. This object is then used. If <em >fname</em> is an absolute
path, <em >searchPath</em> is ignored.
<li> <strong >off_t size() const</strong>:<br/>
Returns the object's size in number of bytes (<em >st_size</em>).
<li> <strong >bool specialMode(size_t special, Combine combine = ALL)</strong>:<br/>
Returns true if the object has the indicated special modes. Multiple
special modes may be specified, which can be combined by the logical
<strong >bitor</strong> operator. By default, if multiple modes are specified, the
resulting pattern must exactly represent the object's mode for the
member function to return <strong >true</strong>. An optional argument <em >ANY</em> may
be specified if the function should return true if at least one
specified mode matches the object's actual mode. The non-special modes
are ignored but a <em >Exception</em> exception is thrown if <em >special</em>
contains other values than those defined by the <strong >SpecialMode</strong> enum.
<li> <strong >Stat::stat const &statStruct() const</strong>:<br/>
Returns a reference to the object's <strong >stat struct</strong>.
<li> <strong >Stat::Type type() const</strong>:<br/>
Returns the <em >Stat::Type</em> value of the object.
<li> <strong >std::string typeStr() const</strong>:<br/>
Returns a textual representation of the object's type as returned by
the <em >Stat::type()</em> member function.
<li> <strong >size_t uid() const</strong>:<br/>
Returns the user ID of the object's owner (<em >st_uid</em>).
</ul>
<p>
<h2 >EXAMPLE</h2>
<pre >
/*
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;
}
</pre>
<p>
<h2 >FILES</h2>
<em >bobcat/stat</em> - defines the class interface
<p>
<h2 >SEE ALSO</h2>
<strong >bobcat</strong>(7), <strong >glob</strong>(3bobcat), <strong >stat</strong>(2)
<p>
<h2 >BUGS</h2>
None Reported.
<p>
<h2 >DISTRIBUTION FILES</h2>
<ul>
<li> <em >bobcat_4.08.02-x.dsc</em>: detached signature;
<li> <em >bobcat_4.08.02-x.tar.gz</em>: source archive;
<li> <em >bobcat_4.08.02-x_i386.changes</em>: change log;
<li> <em >libbobcat1_4.08.02-x_*.deb</em>: debian package holding the
libraries;
<li> <em >libbobcat1-dev_4.08.02-x_*.deb</em>: debian package holding the
libraries, headers and manual pages;
<li> <em >http://sourceforge.net/projects/bobcat</em>: public archive location;
</ul>
<p>
<h2 >BOBCAT</h2>
Bobcat is an acronym of `Brokken's Own Base Classes And Templates'.
<p>
<h2 >COPYRIGHT</h2>
This is free software, distributed under the terms of the
GNU General Public License (GPL).
<p>
<h2 >AUTHOR</h2>
Frank B. Brokken (<strong >f.b.brokken@rug.nl</strong>).
<p>
</body>
</html>
|