35 #include <sys/sysmacros.h>
49 const bool followLink,
50 const unsigned int maxTime
55 if (!fName || !fName[0])
61 volatile bool locIsValid =
false;
63 timer myTimer(maxTime);
69 locIsValid = (::stat(fName, &status_) == 0);
73 locIsValid = (::lstat(fName, &status_) == 0);
84 const fileName& fName,
85 const bool followLink,
86 const unsigned int maxTime
89 fileStat(fName.c_str(), followLink, maxTime)
103 return valid_ ? label(status_.st_size) : 0;
109 return valid_ ? status_.st_mtime : 0;
120 (status_.st_mtime + 1
e-9*status_.st_mtimespec.tv_nsec)
122 (status_.st_mtime + 1
e-9*status_.st_mtim.tv_nsec)
134 major(status_.st_dev) ==
major(other.status_.st_dev)
135 &&
minor(status_.st_dev) ==
minor(other.status_.st_dev)
142 return valid_ && (status_.st_ino == other.status_.st_ino);
148 return valid_ && (status_.st_ino == ino_t(iNode));
156 FixedList<label, 13> list(is);
160 dev_t st_dev =
makedev(list[1], list[2]);
161 fs.status_.st_dev = st_dev;
163 fs.status_.st_ino = list[3];
164 fs.status_.st_mode = list[4];
165 fs.status_.st_uid = list[5];
166 fs.status_.st_gid = list[6];
168 dev_t st_rdev =
makedev(list[7], list[8]);
169 fs.status_.st_rdev = st_rdev;
171 fs.status_.st_size = list[9];
172 fs.status_.st_atime = list[10];
173 fs.status_.st_mtime = list[11];
174 fs.status_.st_ctime = list[12];
183 FixedList<label, 13> list;
185 list[0] = label(fs.valid_);
186 list[1] = label(
major(fs.status_.st_dev));
187 list[2] = label(
minor(fs.status_.st_dev));
188 list[3] = label(fs.status_.st_ino);
189 list[4] = label(fs.status_.st_mode);
190 list[5] = label(fs.status_.st_uid);
191 list[6] = label(fs.status_.st_gid);
192 list[7] = label(
major(fs.status_.st_rdev));
193 list[8] = label(
minor(fs.status_.st_rdev));
194 list[9] = label(fs.status_.st_size);
195 list[10] = label(fs.status_.st_atime);
196 list[11] = label(fs.status_.st_mtime);
197 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.
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,...
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.
OBJstream os(runTime.globalPath()/outputName)
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Istream & operator>>(Istream &, directionInfo &)