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...
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
The modification time in seconds, 0 for an invalid file-stat.
label size() const
Size in bytes, 0 for an invalid file-stat.
double dmodTime() const
The modification time in seconds (nanosecond resolution), 0 for an invalid file-stat.
fileStat()
Default construct.
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 &)
#define timedOut(x)
Check if timeout has occurred.