Module: Essential Tools Module Group: File System Classes
Does not inherit
#include <rw/stat.h> RWFileStat st;
The class RWFileStat provides file statistical information in a portable manner. RWFileStat is:
not Assignable
not Copy Constructible
not Comparable
None
Typedef dev_type // Type for device number (integer) typedef ino_type // Type for inode number (integer) Typedef mode_type // Type for mode (32b unsigned integer) typedef nlink_type // Type for number of hard links (integer) Typedef off_type // Type for offset (integer) Typedef stat_type // Type of the underlying data structure // (default is struct stat)
explicit RWFileStat(const char* bool follow_links = true);
Constructs the object by stat'ing the filename given in s. The call succeeds or throws an exception of type (or derived of) RWInternalErr. The error can be inspected by looking at errno. If the filename indicates a symbolic link, it stats the target of the symbolic link rather than the symbolic link itself when the parameter follow_links is true (default). Otherwise, it stats the symbolic link.
All inherited from the base class.
dev_type dev() const;
Returns the device number for the file.
ino_type inode() const;
Returns the inode number for the file.
bool isBlock() const;
Returns true if the file is a block device.
bool isCharacter() const;
Returns true if the file is a character device.
bool isDirectory() const;
Returns true if the file is a directory.
bool isFifo() const;
Returns true if the file is a FIFO named pipe.
bool isFile() const;
Returns true if the file is a regular file.
bool isSymlink() const;
Returns true if the file is a symlink. This member function will always return false for objects of type RWFileStat.
mode_type mode() const;
Returns an integer which is a bit mask value indicating the type of the file and the permissions for it.
nlink_type nlink() const;
Returns the number or hard links for the file.
off_type size() const;
Returns the size of the file.
const stat_type* stat() const;
Returns a pointer to the underlying type; the type is a struct stat but it may change in the future. Using the returned type directly is not supported.
time_t atime() const; time_t ctime() const; time_t mtime() const;
Return the time of last access, time of last modification and time of last status change respectively.
© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.