#include <ShoreApp.h> shrc Shore::stat(const char *path, OStat *osp);
The OStat structure, defined in OCTypes.h, actually consists of three types. OStat contains some fields that are valid for all objects, registered or anonymous. AnonStat has fields that are valid only for anonymous objects, and RegStat has fields that are valid only for registered objects. The kind field of OStat indicates whether an object is registered or anonymous. The structures are defined as follows:
struct AnonStat
{
LOID pool; // loid of pool in which obj resides
};
struct RegStat
{
short nlink; // num. dir. entries pointing to object
mode_t mode; // permissions flags
uid_t uid; // owner
gid_t gid; // group
time_t atime; // access time
time_t mtime; // modify time
time_t ctime; // props change time
};
struct OStat
{
LOID loid; // object's logical oid
LOID type_loid; // loid of object's type object
ObjectSize csize; // core size
ObjectSize hsize; // heap size
int nindices; // number of indices in object
ObjectKind kind; // KindRegistered or KindAnonymous
AnonStat astat; // if kind == KindAnonymous
RegStat rstat; // if kind == KindRegistered
};
The values of the
kind
field are defined in vas_types.h. Although five values are defined in that
file, only two of those values (KindRegistered and KindAnonymous) can be
found in the
kind
field in the current implementation.
Stat obtains a SH-mode (share-mode) lock on the object.