FBB::Stat(3bobcat)

Characteristics of object in the filesystem
(libbobcat-dev_4.08.03-x.tar.gz)

2005-2018

NAME

FBB::Stat - Determines File Characteristics

SYNOPSIS

#include <bobcat/stat>
Linking option: -lbobcat

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

FBB
All constructors, members, operators and manipulators, mentioned in this man-page, are defined in the namespace FBB.

INHERITS FROM

-

ENUMERATIONS

Stat::Combine:
This enumeration defines the following values:

Stat::Mode:
This enumeration defines the following values:

Stat::SpecialMode:
This enumeration defines the following values:

Stat::Type:
This enumeration, which is identical to the glob(3bobcat) Type enumeration, defines the following values:

CONSTRUCTORS

The copy constructor is available.

OVERLOADED OPERATORS

The default assignment operator is available.

MEMBER FUNCTIONS

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 interface

SEE ALSO

bobcat(7), glob(3bobcat), stat(2)

BUGS

None Reported.

DISTRIBUTION FILES

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).