39#define major(dev) int(((dev) >> 8) & 0xff)
40#define minor(dev) int((dev) & 0xff)
41#define makedev(majNum, minNum) (((unsigned(majNum)) << 8) | (unsigned(minNum)))
55 const bool followLink,
56 const unsigned int maxTime
61 if (!fName || !fName[0])
67 volatile bool locIsValid =
false;
69 timer myTimer(maxTime);
74 locIsValid = (::stat(fName, &status_) == 0);
78 locIsValid = (::stat(fName, &status_) == 0);
82 locIsValid = (::lstat(fName, &status_) == 0);
95 const bool followLink,
96 const unsigned int maxTime
99 fileStat(fName.c_str(), followLink, maxTime)
113 return valid_ ? label(status_.st_size) : 0;
119 return valid_ ? status_.st_mtime : 0;
130 (status_.st_mtime + 1
e-9*status_.st_mtimespec.tv_nsec)
131 #elif defined (_WIN32)
134 (status_.st_mtime + 1
e-9*status_.st_mtim.tv_nsec)
146 major(status_.st_dev) ==
major(other.status_.st_dev)
147 &&
minor(status_.st_dev) ==
minor(other.status_.st_dev)
154 return valid_ && (status_.st_ino == other.status_.st_ino);
160 return valid_ && (status_.st_ino == ino_t(iNode));
172 dev_t st_dev =
makedev(list[1], list[2]);
173 fs.status_.st_dev = st_dev;
175 fs.status_.st_ino = list[3];
176 fs.status_.st_mode = list[4];
177 fs.status_.st_uid = list[5];
178 fs.status_.st_gid = list[6];
180 dev_t st_rdev =
makedev(list[7], list[8]);
181 fs.status_.st_rdev = st_rdev;
183 fs.status_.st_size = list[9];
184 fs.status_.st_atime = list[10];
185 fs.status_.st_mtime = list[11];
186 fs.status_.st_ctime = list[12];
197 list[0] = label(fs.valid_);
198 list[1] = label(
major(fs.status_.st_dev));
199 list[2] = label(
minor(fs.status_.st_dev));
200 list[3] = label(fs.status_.st_ino);
201 list[4] = label(fs.status_.st_mode);
202 list[5] = label(fs.status_.st_uid);
203 list[6] = label(fs.status_.st_gid);
204 list[7] = label(
major(fs.status_.st_rdev));
205 list[8] = label(
minor(fs.status_.st_rdev));
206 list[9] = label(fs.status_.st_size);
207 list[10] = label(fs.status_.st_atime);
208 list[11] = label(fs.status_.st_mtime);
209 list[12] = label(fs.status_.st_ctime);
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
#define makedev(majNum, minNum)
#define timedOut(x)
Check if timeout has occurred.
A 1D vector of objects of type <T> with a fixed length <N>.
virtual bool check(const char *operation) const
Check IOstream status for given operation.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A class for handling file names.
Wrapper for stat() and lstat() system calls.
time_t modTime() const
Return the modification time in seconds.
label size() const
Size in bytes. Zero for an invalid file-stat.
double dmodTime() const
Return the modification time in seconds (nanosecond resolution)
fileStat()
Empty constructor.
bool sameINode(const fileStat &other) const
Compare two fileStats for same Inode.
bool sameDevice(const fileStat &other) const
Compare two fileStats for same device.
Implements a timeout mechanism via sigalarm.
OBJstream os(runTime.globalPath()/outputName)
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Istream & operator>>(Istream &, directionInfo &)