includefile(include/header)

COMMENT( see also getgroups )

COMMENT(manpage, section, releasedate, archive, short name)
manpage(FBB::Stat)(3bobcat)(_CurYrs_)(libbobcat-dev__CurVers_-x.tar.gz)
                    (Characteristics of object in the filesystem)

manpagename(FBB::Stat)(Determines File Characteristics)

manpagesynopsis()
    bf(#include <bobcat/stat>)nl()
    Linking option: tt(-lbobcat) 

manpagedescription()
    bf(Stat) is a wrapper around the bf(stat)(2) system function. In
particular, it offers features to test directly for object
characteristics offered by bf(stat)(2). To determine whether an object exists
the tt(Stat bool) conversion operator can be used.

includefile(include/namespace)

manpagesection(INHERITS FROM)
    -

manpagesection(ENUMERATIONS)

    bf(Stat::Combine): nl() 
        This enumeration defines the following values:
        itemization(
        it() bf(ALL): require all of the specified bf(Mode) or 
                bf(SpecialMode) values to match;
        it() bf(ANY): require any match of the specified bf(Mode) or 
                bf(SpecialMode) values (one match suffices);
        )
 
    bf(Stat::Mode): nl() 
        This enumeration defines the following values:
        itemization(
       it() bf(UR): the owner of the object has read permissions
       it() bf(UW): the owner of the object has write permissions
       it() bf(UX): the owner of the object has execute permissions
       it() bf(GR): the group to which the object belongs has read permissions
       it() bf(GW): the group to which the object belongs has write
        permissions
       it() bf(GX): the group to which the object belongs has execute
        permissions
       it() bf(OR): others have read permissions
       it() bf(OW): others have write permissions
       it() bf(OX): others have execute permissions
       it() bf(READ): equal to tt(UR | GR | OR)
       it() bf(WRITE): equal to tt(UW | GW | OW)
       it() bf(EXEC): equal to tt(UX | GX | OX)
       it() bf(RWX): all of the above.
        )
 
    bf(Stat::SpecialMode): nl() 
        This enumeration defines the following values:
        itemization(
        it() bf(SUID): set UID bit is up
        it() bf(SGID): set GID bit is up
        it() bf(SB): sticky bit is up
        )
 
    bf(Stat::Type): nl() 
        This enumeration, which is identical to the bf(glob)(3bobcat) tt(Type)
            enumeration,  defines the following values:
        includefile(gs.inc)

manpagesection(CONSTRUCTORS)
    itemization(
    itb(Stat())
        The default constructor, creating an empty bf(Stat) object.
    itb(Stat(std::string const &fname))
       Initializes a bf(Stat) with a given object name.
    itb(Stat(std::string const &fname, std::string const &searchPath))
       Initializes a bf(Stat) with a given object name, where the object is
        searched in the tt(searchPath) directories, which is a colon-separated
        string of directory names. The filenames are constructed by appending
        tt(fname) to each of the elements of tt(searchPath) until an existing
        object is found. This object is then used. If tt(fname) is an absolute
        path, tt(searchPath) is ignored.
    )
    The copy constructor is available.

manpagesection(OVERLOADED OPERATORS)
    itemization(
    itb(operator bool() const)
       This operator returns tt(true) if the tt(Stat) object holds information
        about an existing object. Otherwise tt(false) is returned.
    )

    The default assignment operator is available.

manpagesection(MEMBER FUNCTIONS)
    itemization(
    itb(bool access(FBB::User const &user, size_t spec, bool useEffective =
        true) const)
       Returns tt(true) if tt(user) has the permissions as specified at
        tt(spec) (of which only the defined tt(Mode) 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 tt(false). E.g, when specifying tt(access(user, UW |
        UR | GR)) then the user em(must) 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 tt(UR | GR)) then this member returns tt(true) if at least one
        of the requested read, write, or execute permissions are granted for
        tt(user).
    itb(size_t blockSize() const)
        Returns the blocksize (tt(st_blksize)) for filesystem I/O
    itb(size_t device() const)
        Returns the device id (tt(st_dev)).
    itb(size_t deviceType() const)
       Returns the device type number, but only if the object type is
        bf(DEVICE) (tt(st_rdev)).
    itb(size_t error() const)
       Returns the error number associated with an error, in cases where
        bf(operator bool()) returns bf(false). A returned value of 0 indicates
        `no errors'.
    itb(bool isType(Stat::Type probe))
       Returns tt(true) if the object has the probed type otherwise tt(false)
        is returned.
    itb(size_t inode() const)
        Returns the inode number (tt(st_ino)).
    itb(size_t gid() const)
        Returns the group ID of the object's owner (tt(st_gid)).
    itb(FBB::DateTime lastAccess() const)
        Returns a bf(FBB::DateTime) object holding information about the
        object's time of last access (tt(st_atime)) (using UTC).
    itb(FBB::DateTime lastChange() const)
        Returns a bf(FBB::DateTime) object holding information about the
        object's time of last status change (tt(st_ctime)) (using UTC).
    itb(FBB::DateTime lastModification() const)
        Returns a bf(FBB::DateTime) object holding information about the
        object's last modification time (tt(st_mtime)) (using UTC).
    itb(size_t mode() const)
       Returns the object's raw, uninterpreted mode (tt(st_mode & RWX)). Note
        that this value is usually displayed (and is processed most easily) as
        an octal value.
    itb(bool mode(size_t mode, Combine combine = ALL))
       Returns true if the object has the indicated mode. Multiple modes may
        be set, which can be combined by the logical bf(bitor) operator. By
        default, if multiple modes are specified, the resulting pattern must
        exactly represent the object's mode for the member function to return
        bf(true). An optional argument tt(ANY) may be specified if the
        function should return true if at least one specified mode matches the
        object's actual mode. An tt(Exception) exception is thrown if the
        specified tt(mode) contains other values than the defined bf(Mode)
        or bf(SpecialMode) values. 
    itb(std::string modeStr() const)
       Returns the standard string-representation of the object's mode (e.g.,
        tt(rw-r--r--)). Special modes (e.g., suid) are indicated by tt(s)
        instead of tt(x) when the object is user and/or group executable and
        by tt(S) if the object has the special mode bit(s) set, but is not
        executable. For the `other' executable mode flag tt(t) is used
        (`sticky' bit) and tt(T) if the object is not `other' executable.
    itb(std::string const &name() const)
        Returns the object's name as specified in the constructor or bf(set())
        member function.
    itb(size_t nBlocks() const)
        Returns the object's number of allocated blocks (tt(st_blocks)).
    itb(size_t nLinks() const)
        Returns the object's number of hard links (tt(st_nlink)).
    itb(std::string path() const)
        Returns the object's full pathname. If the full pathname could not be
        determined, an empty string is returned.
    itb(bool set(std::string const &name))
       Redefine the bf(Stat) object to represent the information about
        the indicated object name.
    itb(bool set(std::string const &name, std::string const &pathlist))
       Redefine the bf(Stat) object to represent the information about the
        indicated object name, where the object is searched in the
        tt(pathlist) directories, which is a colon-separated string of
        directory names. The object names are constructed by appending
        tt(fname) to each of the elements of tt(searchPath) until an existing
        object is found. This object is then used. If tt(fname) is an absolute
        path, tt(searchPath) is ignored.
    itb(off_t size() const)
        Returns the object's size in number of bytes (tt(st_size)).
    itb(bool specialMode(size_t special, Combine combine = ALL)) 
       Returns true if the object has the indicated special modes.  Multiple
        special modes may be specified, which can be combined by the logical
        bf(bitor) operator. By default, if multiple modes are specified, the
        resulting pattern must exactly represent the object's mode for the
        member function to return bf(true). An optional argument tt(ANY) 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 tt(Exception) exception is thrown if tt(special)
        contains other values than those defined by the bf(SpecialMode) enum. 
    itb(Stat::stat const &statStruct() const)
        Returns a reference to the object's bf(stat struct).
    itb(Stat::Type type() const)
       Returns the tt(Stat::Type) value of the object.
    itb(std::string typeStr() const)
       Returns a textual representation of the object's type as returned by
        the tt(Stat::type()) member function.
    itb(size_t uid() const)
        Returns the user ID of the object's owner (tt(st_uid)).
    )

manpagesection(EXAMPLE)
    verbinclude(../../stat/driver/driver.cc)

manpagefiles()
    em(bobcat/stat) - defines the class interface

manpageseealso()
    bf(bobcat)(7), bf(glob)(3bobcat), bf(stat)(3)

manpagebugs()
    None Reported.

includefile(include/trailer)
