NAME
OUX_Stat -
Class wrapper around the system stat structure.
SYNOPSIS
#include <OUX/files/stat.hh>
class OUX_Stat : public OTC_Stat
{
public:
static os_typespec* get_os_typespec();
inline OUX_Stat();
inline OUX_Stat(OUX_Stat const& theStat);
inline ino_t ino() const;
inline short nlink() const;
inline uid_t uid() const;
inline gid_t gid() const;
inline dev_t rdev() const;
inline long blksize() const;
inline long blocks() const;
inline OTC_Boolean isSymbolicLink() const;
inline OTC_Boolean isSocket() const;
inline OTC_Boolean isSetUid() const;
inline OTC_Boolean isSetGid() const;
inline OTC_Boolean isSaveTxt() const;
inline OTC_Boolean isGroupRead() const;
inline OTC_Boolean isGroupWrite() const;
inline OTC_Boolean isGroupExec() const;
inline OTC_Boolean isOtherRead() const;
inline OTC_Boolean isOtherWrite() const;
inline OTC_Boolean isOtherExec() const;
};
CLASS TYPE
Concrete
EXAMPLE
OUX_Stat info;
if (stat("/tmp",info) == 0)
{
if (info.isDirectory())
cout << "Is a directory" << endl;
}
ATTRIBUTES
inline ino_t ino() const;
Returns the inode of the file.
inline short nlink() const;
Returns the number of hardlinks to the
file.
inline uid_t uid() const;
Returns the owners user id.
inline gid_t gid() const;
Returns the group user id.
inline dev_t rdev() const;
inline long blksize() const;
Returns the optimal blocksize for file
system i/o operations.
inline long blocks() const;
Returns the number of blocks allocated to
the file.
The following simplify questions commonly asked about files.
inline OTC_Boolean isSymbolicLink() const;
Returns OTCLIB_TRUE if file is a
symbolic link.
inline OTC_Boolean isSocket() const;
Returns OTCLIB_TRUE if file is a socket.
inline OTC_Boolean isSetUid() const;
Returns OTCLIB_TRUE if file is setuid.
inline OTC_Boolean isSetGid() const;
Returns OTCLIB_TRUE if file is setgid.
inline OTC_Boolean isSaveTxt() const;
Returns OTCLIB_TRUE if file is has its
stickybit set.
inline OTC_Boolean isGroupRead() const;
Returns OTCLIB_FALSE if not readable by
the users in the group of the file.
inline OTC_Boolean isGroupWrite() const;
Returns OTCLIB_FALSE if not writable by
the users in the group of the file.
inline OTC_Boolean isGroupExec() const;
Returns OTCLIB_FALSE if not executable
by the users in the group of the file.
inline OTC_Boolean isOtherRead() const;
Returns OTCLIB_FALSE if not readable by
any users.
inline OTC_Boolean isOtherWrite() const;
Returns OTCLIB_FALSE if not writable by
any users.
inline OTC_Boolean isOtherExec() const;
Returns OTCLIB_FALSE if not executable by
any users.
DECSCRIPTION
Encapsulates the system stat structure to make deriving information
about a file easier. Note that it is still necessary to use the
system stat() function to fill out information in the class.
This derived version of OTC_Stat adds extra functionality
particular to UNIX.
SEE ALSO
stat(2)
LIBRARY
OUX
AUTHOR(S)
Graham Dumpleton
COPYRIGHT
Copyright 1991 1992 OTC LIMITED