Public Member Functions | Friends | List of all members
fileStat Class Reference

Wrapper for stat() and lstat() system calls. More...

Public Member Functions

 fileStat ()
 
 fileStat (const char *fName, const bool followLink=true, const unsigned int maxTime=0)
 
 fileStat (const fileName &fName, const bool followLink=true, const unsigned int maxTime=0)
 
 fileStat (Istream &is)
 
const struct stat & status () const
 
bool valid () const
 
label size () const
 
time_t modTime () const
 
double dmodTime () const
 
bool sameDevice (const fileStat &other) const
 
bool sameINode (const fileStat &other) const
 
bool sameINode (const label iNode) const
 

Friends

Istreamoperator>> (Istream &is, fileStat &fs)
 
Ostreamoperator<< (Ostream &os, const fileStat &fs)
 

Detailed Description

Wrapper for stat() and lstat() system calls.

Warning
On Linux (an maybe on others) a stat() of an nfs mounted (remote) file does never timeout and cannot be interrupted! So e.g. Foam::ping first and hope nfs is running.
Source files

Definition at line 63 of file fileStat.H.

Constructor & Destructor Documentation

◆ fileStat() [1/4]

fileStat ( )

Definition at line 33 of file fileStat.C.

◆ fileStat() [2/4]

fileStat ( const char *  fName,
const bool  followLink = true,
const unsigned int  maxTime = 0 
)

Definition at line 40 of file fileStat.C.

References timedOut.

◆ fileStat() [3/4]

fileStat ( const fileName fName,
const bool  followLink = true,
const unsigned int  maxTime = 0 
)

Definition at line 76 of file fileStat.C.

◆ fileStat() [4/4]

fileStat ( Istream is)
explicit

Definition at line 86 of file fileStat.C.

Member Function Documentation

◆ status()

const struct stat& status ( ) const
inline

Definition at line 118 of file fileStat.H.

Referenced by Foam::fileSize(), and Foam::mode().

Here is the caller graph for this function:

◆ valid()

bool valid ( ) const
inline

Definition at line 124 of file fileStat.H.

Referenced by Foam::fileSize(), and Foam::mode().

Here is the caller graph for this function:

◆ size()

Foam::label size ( ) const

Definition at line 94 of file fileStat.C.

◆ modTime()

time_t modTime ( ) const

Definition at line 100 of file fileStat.C.

Referenced by Foam::lastModified().

Here is the caller graph for this function:

◆ dmodTime()

double dmodTime ( ) const

Definition at line 106 of file fileStat.C.

References Foam::constant::electromagnetic::e, and else.

Referenced by Foam::highResLastModified().

Here is the caller graph for this function:

◆ sameDevice()

bool sameDevice ( const fileStat other) const

Definition at line 122 of file fileStat.C.

◆ sameINode() [1/2]

bool sameINode ( const fileStat other) const

Definition at line 133 of file fileStat.C.

◆ sameINode() [2/2]

bool sameINode ( const label  iNode) const

Definition at line 139 of file fileStat.C.

Friends And Related Function Documentation

◆ operator>>

Istream& operator>> ( Istream is,
fileStat fs 
)
friend

◆ operator<<

Ostream& operator<< ( Ostream os,
const fileStat fs 
)
friend

The documentation for this class was generated from the following files: