Wrapper for stat() and lstat() system calls. More...
Public Member Functions | |
fileStat () | |
Empty constructor. More... | |
fileStat (const char *fName, const bool followLink=true, const unsigned int maxTime=0) | |
Construct from components. More... | |
fileStat (const fileName &fName, const bool followLink=true, const unsigned int maxTime=0) | |
Construct from components. More... | |
fileStat (Istream &is) | |
Construct from Istream. More... | |
const struct stat & | status () const |
Raw status. More... | |
bool | valid () const |
Was file-stat successful? More... | |
label | size () const |
Size in bytes. Zero for an invalid file-stat. More... | |
time_t | modTime () const |
Return the modification time in seconds. More... | |
double | dmodTime () const |
Return the modification time in seconds (nanosecond resolution) More... | |
bool | sameDevice (const fileStat &other) const |
Compare two fileStats for same device. More... | |
bool | sameINode (const fileStat &other) const |
Compare two fileStats for same Inode. More... | |
bool | sameINode (const label iNode) const |
Compare state against inode. More... | |
fileStat () | |
Empty constructor. More... | |
fileStat (const char *fName, const bool followLink=true, const unsigned int maxTime=0) | |
Construct from components. More... | |
fileStat (const fileName &fName, const bool followLink=true, const unsigned int maxTime=0) | |
Construct from components. More... | |
fileStat (Istream &is) | |
Construct from Istream. More... | |
const struct stat & | status () const |
Raw status. More... | |
bool | valid () const |
Was file-stat successful? More... | |
label | size () const |
Size in bytes. Zero for an invalid file-stat. More... | |
time_t | modTime () const |
Return the modification time in seconds. More... | |
double | dmodTime () const |
Return the modification time in seconds (nanosecond resolution) More... | |
bool | sameDevice (const fileStat &other) const |
Compare two fileStats for same device. More... | |
bool | sameINode (const fileStat &other) const |
Compare two fileStats for same Inode. More... | |
bool | sameINode (const label iNode) const |
Compare state against inode. More... | |
Friends | |
Istream & | operator>> (Istream &is, fileStat &fs) |
Ostream & | operator<< (Ostream &os, const fileStat &fs) |
Istream & | operator>> (Istream &is, fileStat &fs) |
Ostream & | operator<< (Ostream &os, const fileStat &fs) |
Wrapper for stat() and lstat() system calls.
Definition at line 67 of file fileStat.H.
fileStat | ( | ) |
Empty constructor.
Definition at line 46 of file fileStat.C.
Construct from components.
fName | The file name or directory name to stat. |
followLink | If it is a link, get the status of the source file/directory. |
maxTime | The timeout value. |
Definition at line 53 of file fileStat.C.
References timedOut.
Construct from components.
fName | The file name or directory name to stat. |
followLink | If it is a link, get the status of the source file/directory. |
maxTime | The timeout value. |
Definition at line 93 of file fileStat.C.
Construct from Istream.
Definition at line 103 of file fileStat.C.
fileStat | ( | ) |
Empty constructor.
Construct from components.
fName | The file name or directory name to stat. |
followLink | If it is a link, get the status of the source file/directory. |
maxTime | The timeout value. |
Construct from components.
fName | The file name or directory name to stat. |
followLink | If it is a link, get the status of the source file/directory. |
maxTime | The timeout value. |
|
inline |
Raw status.
Definition at line 122 of file fileStat.H.
Referenced by Foam::fileSize(), and Foam::mode().
|
inline |
Was file-stat successful?
Definition at line 128 of file fileStat.H.
Referenced by Foam::fileSize(), and Foam::mode().
Foam::label size | ( | ) | const |
Size in bytes. Zero for an invalid file-stat.
Definition at line 111 of file fileStat.C.
time_t modTime | ( | ) | const |
Return the modification time in seconds.
Zero for an invalid file-stat.
Definition at line 117 of file fileStat.C.
Referenced by Foam::lastModified().
double dmodTime | ( | ) | const |
Return the modification time in seconds (nanosecond resolution)
Zero for an invalid file-stat.
Definition at line 123 of file fileStat.C.
References Foam::constant::electromagnetic::e, and else.
Referenced by Foam::highResLastModified().
Compare two fileStats for same device.
Definition at line 141 of file fileStat.C.
Compare two fileStats for same Inode.
Definition at line 152 of file fileStat.C.
bool sameINode | ( | const label | iNode | ) | const |
Compare state against inode.
Definition at line 158 of file fileStat.C.
|
inline |
Raw status.
Definition at line 122 of file fileStat.H.
|
inline |
Was file-stat successful?
Definition at line 128 of file fileStat.H.
label size | ( | ) | const |
Size in bytes. Zero for an invalid file-stat.
time_t modTime | ( | ) | const |
Return the modification time in seconds.
Zero for an invalid file-stat.
double dmodTime | ( | ) | const |
Return the modification time in seconds (nanosecond resolution)
Zero for an invalid file-stat.
bool sameINode | ( | const label | iNode | ) | const |
Compare state against inode.