#include <OTC/files/stat.hh> class OTC_Stat {
public:
static os_typespec* get_os_typespec();
inline operator otclib_stat*();
OTC_Stat();
OTC_Stat(OTC_Stat const& theStat);
OTC_Stat& operator=(OTC_Stat const& theStat);
inline dev_t dev() const;
inline u_short mode() const;
inline u_short permissions() const;
inline u_short type() const;
inline off_t size() const;
inline time_t atime() const;
inline time_t mtime() const;
inline time_t ctime() const;
inline OTC_Boolean isDirectory() const;
inline OTC_Boolean isRegularFile() const;
inline OTC_Boolean isCharacterSpecial() const;
inline OTC_Boolean isFifo() const;
inline OTC_Boolean isBlockSpecial() const;
inline OTC_Boolean isUserRead() const;
inline OTC_Boolean isUserWrite() const;
inline OTC_Boolean isUserExec() const;
protected:
otclib_stat myStat;
};
OTC_Stat info;
if (stat("/tmp",info) == 0)
{
if (info.isDirectory())
cout << "Is a directory" << endl;
}
inline dev_t dev() const;
inline u_short mode() const;
inline u_short permissions() const;
inline u_short type() const;
inline off_t size() const;
inline time_t atime() const;
inline time_t mtime() const;
inline time_t ctime() const;
inline OTC_Boolean isDirectory() const;
OTCLIB_TRUE
if file is a
directory.
inline OTC_Boolean isRegularFile() const;
OTCLIB_TRUE
if file is a regular
file.
inline OTC_Boolean isCharacterSpecial() const;
OTCLIB_TRUE
if file is a character
special file.
inline OTC_Boolean isFifo() const;
OTCLIB_TRUE
if file is a fifo.
inline OTC_Boolean isBlockSpecial() const;
OTCLIB_TRUE
if file is a block
special file.
inline OTC_Boolean isUserRead() const;
OTCLIB_FALSE
if not readable by
the user who owns the file.
inline OTC_Boolean isUserWrite() const;
OTCLIB_FALSE
if not writable by
the user who owns the file.
inline OTC_Boolean isUserExec() const;
OTCLIB_FALSE
if not executable
by the user who owns the file.
stat()
function to fill out information in the class.
stat(2)