Wrapper for stat() and lstat() system calls. More...
#include <fileStat.H>
Public Member Functions | |
| fileStat () | |
| Default construct. | |
| fileStat (const char *fName, const bool followLink=true, const unsigned int maxTime=0) | |
| Construct from components. | |
| fileStat (const fileName &fName, const bool followLink=true, const unsigned int maxTime=0) | |
| Construct from components. | |
| fileStat (Istream &is) | |
| Construct from Istream. | |
| bool | good () const noexcept |
| True if file-stat was successful. | |
| operator bool () const noexcept | |
| True if file-stat was successful. | |
| const struct stat & | status () const noexcept |
| The raw status. | |
| label | size () const |
| Size in bytes, 0 for an invalid file-stat. | |
| time_t | modTime () const |
| The modification time in seconds, 0 for an invalid file-stat. | |
| double | dmodTime () const |
| The modification time in seconds (nanosecond resolution), 0 for an invalid file-stat. | |
| bool | sameDevice (const fileStat &other) const |
| Compare two fileStats for same device. | |
| bool | sameINode (const fileStat &other) const |
| Compare two fileStats for same Inode. | |
| bool | sameINode (const label iNode) const |
| Compare state against inode. | |
| bool | valid () const noexcept |
| True if file-stat was successful. | |
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.
Referenced by fileStat(), operator<<, operator>>, sameDevice(), and sameINode().

|
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 39 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 75 of file fileStat.C.
References fileStat().

|
explicit |
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.
References Foam::noexcept.
Referenced by Foam::fileSize(), Foam::mode(), and valid().

|
inlineexplicitnoexcept |
True if file-stat was successful.
Definition at line 138 of file fileStat.H.
References Foam::noexcept.
|
inlinenoexcept |
The raw status.
Definition at line 146 of file fileStat.H.
References Foam::noexcept.
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.
Referenced by Foam::highResLastModified().

| bool sameDevice | ( | const fileStat & | other | ) | const |
Compare two fileStats for same device.
Definition at line 122 of file fileStat.C.
References fileStat().

| bool sameINode | ( | const fileStat & | other | ) | const |
Compare two fileStats for same Inode.
Definition at line 133 of file fileStat.C.
References fileStat().

| 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 good(), and Foam::noexcept.

References fileStat().
References fileStat(), and os().