FreeFOAM The Cross-Platform CFD Toolkit
fileStat Class Reference

Wrapper for stat() system call. More...

#include <OSspecific/fileStat.H>


Detailed Description

Wrapper for stat() system call.

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 66 of file fileStat.H.

List of all members.

Public Member Functions

 fileStat ()
 Empty constructor.
 fileStat (const fileName &fName, const unsigned int maxTime=0)
 Construct from components.
 fileStat (Istream &)
 Construct from Istream.
struct stat & status () const
 Raw status.
bool isValid () const
 Did constructor fail.
bool sameDevice (const fileStat &stat2) const
 compare two fileStats for same device
bool sameINode (const fileStat &stat2) const
 compare two fileStats for same Inode
bool sameINode (const label iNode) const
 compare state against inode

Friends

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

Constructor & Destructor Documentation

fileStat ( )

Empty constructor.

Definition at line 36 of file fileStat.C.

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

Construct from components.

Definition at line 42 of file fileStat.C.

References timedOut.

fileStat ( Istream is)

Construct from Istream.

Definition at line 66 of file fileStat.C.


Member Function Documentation

struct stat& status ( ) const
inlineread

Raw status.

Definition at line 94 of file fileStat.H.

Referenced by Foam::fileSize(), Foam::lastModified(), Foam::mode(), fileStat::sameDevice(), and fileStat::sameINode().

bool isValid ( ) const
inline

Did constructor fail.

Definition at line 100 of file fileStat.H.

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

bool sameDevice ( const fileStat stat2) const

compare two fileStats for same device

Definition at line 74 of file fileStat.C.

References fileStat::status().

bool sameINode ( const fileStat stat2) const

compare two fileStats for same Inode

Definition at line 85 of file fileStat.C.

References fileStat::status().

bool sameINode ( const label  iNode) const

compare state against inode

Definition at line 91 of file fileStat.C.


Friends And Related Function Documentation

Istream& operator>> ( Istream ,
fileStat  
)
friend
Ostream& operator<< ( Ostream ,
const fileStat  
)
friend

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