Wrapper for stat() and lstat() system calls. More...
Public Member Functions | |
fileStat () | |
Default construct. 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... | |
bool | good () const noexcept |
True if file-stat was successful. More... | |
operator bool () const noexcept | |
True if file-stat was successful. More... | |
const struct stat & | status () const noexcept |
The raw status. More... | |
label | size () const |
Size in bytes, 0 for an invalid file-stat. More... | |
time_t | modTime () const |
The modification time in seconds, 0 for an invalid file-stat. More... | |
double | dmodTime () const |
The modification time in seconds (nanosecond resolution), 0 for an invalid file-stat. 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... | |
bool | valid () const noexcept |
True if file-stat was successful. More... | |
Friends | |
Istream & | operator>> (Istream &is, fileStat &fs) |
Ostream & | operator<< (Ostream &os, const fileStat &fs) |
Wrapper for stat() and lstat() system calls.
Definition at line 63 of file fileStat.H.
fileStat | ( | ) |
Default construct.
Definition at line 33 of file fileStat.C.
|
explicit |
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 40 of file fileStat.C.
References timedOut.
|
explicit |
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 76 of file fileStat.C.
Construct from Istream.
Definition at line 86 of file fileStat.C.
|
inlinenoexcept |
True if file-stat was successful.
Definition at line 130 of file fileStat.H.
Referenced by Foam::fileSize(), Foam::mode(), and fileStat::valid().
|
inlineexplicitnoexcept |
True if file-stat was successful.
Definition at line 138 of file fileStat.H.
|
inlinenoexcept |
The raw status.
Definition at line 146 of file fileStat.H.
Referenced by Foam::fileSize(), and Foam::mode().
Foam::label size | ( | ) | const |
Size in bytes, 0 for an invalid file-stat.
Definition at line 94 of file fileStat.C.
time_t modTime | ( | ) | const |
The modification time in seconds, 0 for an invalid file-stat.
Definition at line 100 of file fileStat.C.
Referenced by Foam::lastModified().
double dmodTime | ( | ) | const |
The modification time in seconds (nanosecond resolution), 0 for an invalid file-stat.
Definition at line 106 of file fileStat.C.
References Foam::constant::electromagnetic::e, and else.
Referenced by Foam::highResLastModified().
bool sameDevice | ( | const fileStat & | other | ) | const |
Compare two fileStats for same device.
Definition at line 122 of file fileStat.C.
bool sameINode | ( | const fileStat & | other | ) | const |
Compare two fileStats for same Inode.
Definition at line 133 of file fileStat.C.
bool sameINode | ( | const label | iNode | ) | const |
Compare state against inode.
Definition at line 139 of file fileStat.C.
|
inlinenoexcept |
True if file-stat was successful.
Definition at line 198 of file fileStat.H.
References fileStat::good().
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.