uncollatedFileOperation.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2017-2018 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
27 #include "Time.H"
28 #include "IFstream.H"
29 #include "OFstream.H"
31 #include "decomposedBlockData.H"
32 #include "dummyISstream.H"
33 #include "unthreadedInitialise.H"
34 
35 /* * * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * * */
36 
37 namespace Foam
38 {
39 namespace fileOperations
40 {
41  defineTypeNameAndDebug(uncollatedFileOperation, 0);
42  addToRunTimeSelectionTable(fileOperation, uncollatedFileOperation, word);
43 
44  // Mark as not needing threaded mpi
46  (
47  fileOperationInitialise,
48  unthreadedInitialise,
49  word,
50  uncollated
51  );
52 }
53 }
54 
55 
56 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
57 
58 Foam::fileName Foam::fileOperations::uncollatedFileOperation::filePathInfo
59 (
60  const bool checkGlobal,
61  const bool isFile,
62  const IOobject& io
63 ) const
64 {
65  if (io.instance().isAbsolute())
66  {
67  fileName objectPath = io.instance()/io.name();
68 
69  if (isFileOrDir(isFile, objectPath))
70  {
71  return objectPath;
72  }
73  else
74  {
75  return fileName::null;
76  }
77  }
78  else
79  {
80  fileName path = io.path();
81  fileName objectPath = path/io.name();
82 
83  if (isFileOrDir(isFile, objectPath))
84  {
85  return objectPath;
86  }
87  else
88  {
89  if
90  (
91  checkGlobal
92  && io.time().processorCase()
93  && (
94  io.instance() == io.time().system()
95  || io.instance() == io.time().constant()
96  )
97  )
98  {
99  // Constant & system can come from global case
100 
101  fileName parentObjectPath =
102  io.rootPath()/io.time().globalCaseName()
103  /io.instance()/io.db().dbDir()/io.local()/io.name();
104 
105  if (isFileOrDir(isFile, parentObjectPath))
106  {
107  return parentObjectPath;
108  }
109  }
110 
111  // Check if parallel "procesors" directory
112  if (io.time().processorCase())
113  {
114  tmpNrc<dirIndexList> pDirs
115  (
116  lookupProcessorsPath(io.objectPath())
117  );
118  forAll(pDirs(), i)
119  {
120  const fileName& pDir = pDirs()[i].first();
121  fileName objPath =
122  processorsPath(io, io.instance(), pDir)
123  /io.name();
124  if (objPath != objectPath && isFileOrDir(isFile, objPath))
125  {
126  return objPath;
127  }
128  }
129  }
130 
131 
132  // Check for approximately same time. E.g. if time = 1e-2 and
133  // directory is 0.01 (due to different time formats)
134  if (!Foam::isDir(path))
135  {
136  word newInstancePath = io.time().findInstancePath
137  (
138  instant(io.instance())
139  );
140 
141  if (newInstancePath.size())
142  {
143  fileName fName
144  (
145  io.rootPath()/io.caseName()
146  /newInstancePath/io.db().dbDir()/io.local()/io.name()
147  );
148 
149  if (isFileOrDir(isFile, fName))
150  {
151  return fName;
152  }
153  }
154  }
155  }
156 
157  return fileName::null;
158  }
159 }
160 
161 
162 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
163 
165 (
166  const bool verbose
167 )
168 :
170 {
171  if (verbose)
172  {
173  Info<< "I/O : " << typeName << endl;
174  }
175 }
176 
177 
178 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
179 
181 {}
182 
183 
184 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
185 
187 (
188  const fileName& dir,
189  mode_t mode
190 ) const
191 {
192  return Foam::mkDir(dir, mode);
193 }
194 
195 
197 (
198  const fileName& fName,
199  mode_t mode
200 ) const
201 {
202  return Foam::chMod(fName, mode);
203 }
204 
205 
207 (
208  const fileName& fName,
209  const bool followLink
210 ) const
211 {
212  return Foam::mode(fName, followLink);
213 }
214 
215 
217 (
218  const fileName& fName,
219  const bool followLink
220 ) const
221 {
222  return Foam::type(fName, followLink);
223 }
224 
225 
227 (
228  const fileName& fName,
229  const bool checkGzip,
230  const bool followLink
231 ) const
232 {
233  return Foam::exists(fName, checkGzip, followLink);
234 }
235 
236 
238 (
239  const fileName& fName,
240  const bool followLink
241 ) const
242 {
243  return Foam::isDir(fName, followLink);
244 }
245 
246 
248 (
249  const fileName& fName,
250  const bool checkGzip,
251  const bool followLink
252 ) const
253 {
254  return Foam::isFile(fName, checkGzip, followLink);
255 }
256 
257 
259 (
260  const fileName& fName,
261  const bool followLink
262 ) const
263 {
264  return Foam::fileSize(fName, followLink);
265 }
266 
267 
269 (
270  const fileName& fName,
271  const bool followLink
272 ) const
273 {
274  return Foam::lastModified(fName, followLink);
275 }
276 
277 
279 (
280  const fileName& fName,
281  const bool followLink
282 ) const
283 {
284  return Foam::highResLastModified(fName, followLink);
285 }
286 
287 
289 (
290  const fileName& fName,
291  const std::string& ext
292 ) const
293 {
294  return Foam::mvBak(fName, ext);
295 }
296 
297 
299 (
300  const fileName& fName
301 ) const
302 {
303  return Foam::rm(fName);
304 }
305 
306 
308 (
309  const fileName& dir
310 ) const
311 {
312  return Foam::rmDir(dir);
313 }
314 
315 
317 (
318  const fileName& dir,
319  const fileName::Type type,
320  const bool filtergz,
321  const bool followLink
322 ) const
323 {
324  return Foam::readDir(dir, type, filtergz, followLink);
325 }
326 
327 
329 (
330  const fileName& src,
331  const fileName& dst,
332  const bool followLink
333 ) const
334 {
335  return Foam::cp(src, dst, followLink);
336 }
337 
338 
340 (
341  const fileName& src,
342  const fileName& dst
343 ) const
344 {
345  return Foam::ln(src, dst);
346 }
347 
348 
350 (
351  const fileName& src,
352  const fileName& dst,
353  const bool followLink
354 ) const
355 {
356  return Foam::mv(src, dst, followLink);
357 }
358 
359 
361 (
362  const bool checkGlobal,
363  const IOobject& io,
364  const word& typeName
365 ) const
366 {
367  if (debug)
368  {
369  Pout<< "uncollatedFileOperation::filePath :"
370  << " objectPath:" << io.objectPath()
371  << " checkGlobal:" << checkGlobal << endl;
372  }
373 
374  fileName objPath(filePathInfo(checkGlobal, true, io));
375 
376  if (debug)
377  {
378  Pout<< "uncollatedFileOperation::filePath :"
379  << " Returning from file searching:" << endl
380  << " objectPath:" << io.objectPath() << endl
381  << " filePath :" << objPath << endl << endl;
382  }
383  return objPath;
384 }
385 
386 
388 (
389  const bool checkGlobal,
390  const IOobject& io
391 ) const
392 {
393  if (debug)
394  {
395  Pout<< "uncollatedFileOperation::dirPath :"
396  << " objectPath:" << io.objectPath()
397  << " checkGlobal:" << checkGlobal << endl;
398  }
399 
400  fileName objPath(filePathInfo(checkGlobal, false, io));
401 
402  if (debug)
403  {
404  Pout<< "uncollatedFileOperation::dirPath :"
405  << " Returning from directory searching:" << endl
406  << " objectPath:" << io.objectPath() << endl
407  << " dirPath :" << objPath << endl << endl;
408  }
409  return objPath;
410 }
411 
412 
414 (
415  const objectRegistry& db,
416  const fileName& instance,
417  const fileName& local,
418  word& newInstance
419 ) const
420 {
421  if (debug)
422  {
423  Pout<< "uncollatedFileOperation::readObjects :"
424  << " db:" << db.objectPath()
425  << " instance:" << instance << endl;
426  }
427 
428  //- Use non-time searching version
429  fileNameList objectNames
430  (
431  fileOperation::readObjects(db, instance, local, newInstance)
432  );
433 
434  if (newInstance.empty())
435  {
436  // Find similar time
437  fileName newInst = db.time().findInstancePath(instant(instance));
438  if (!newInst.empty() && newInst != instance)
439  {
440  // Try with new time
441  objectNames = fileOperation::readObjects
442  (
443  db,
444  newInst,
445  local,
446  newInstance
447  );
448  }
449  }
450 
451  if (debug)
452  {
453  Pout<< "uncollatedFileOperation::readObjects :"
454  << " newInstance:" << newInstance
455  << " objectNames:" << objectNames << endl;
456  }
457 
458  return objectNames;
459 }
460 
461 
463 (
464  IOobject& io,
465  const fileName& fName,
466  const word& typeName
467 ) const
468 {
469  if (fName.empty())
470  {
471  if (IOobject::debug)
472  {
474  << "file " << io.objectPath() << " could not be opened"
475  << endl;
476  }
477 
478  return false;
479  }
480 
481  autoPtr<ISstream> isPtr(NewIFstream(fName));
482 
483  if (!isPtr.valid() || !isPtr->good())
484  {
485  return false;
486  }
487 
488  bool ok = io.readHeader(isPtr());
489 
490  if (io.headerClassName() == decomposedBlockData::typeName)
491  {
492  // Read the header inside the container (master data)
493  ok = decomposedBlockData::readMasterHeader(io, isPtr());
494  }
495 
496  return ok;
497 }
498 
499 
502 (
503  regIOobject& io,
504  const fileName& fName,
505  const word& typeName,
506  const bool valid
507 ) const
508 {
509  autoPtr<ISstream> isPtr;
510 
511  if (!valid)
512  {
513  isPtr = autoPtr<ISstream>(new dummyISstream());
514  return isPtr;
515  }
516 
517  if (fName.empty())
518  {
520  << "cannot find file " << io.objectPath()
521  << exit(FatalError);
522  }
523 
524  isPtr = NewIFstream(fName);
525 
526  if (!isPtr.valid() || !isPtr->good())
527  {
529  (
530  "uncollatedFileOperation::readStream()",
531  __FILE__,
532  __LINE__,
533  fName,
534  0
535  ) << "cannot open file"
536  << exit(FatalIOError);
537  }
538  else if (!io.readHeader(isPtr()))
539  {
540  FatalIOErrorInFunction(isPtr())
541  << "problem while reading header for object " << io.name()
542  << exit(FatalIOError);
543  }
544 
545  if (io.headerClassName() != decomposedBlockData::typeName)
546  {
547  return isPtr;
548  }
549  else
550  {
551  // Analyse the objectpath to find out the processor we're trying
552  // to access
553  label proci = detectProcessorPath(io.objectPath());
554 
555  if (proci == -1)
556  {
557  FatalIOErrorInFunction(isPtr())
558  << "could not detect processor number"
559  << " from objectPath:" << io.objectPath()
560  << exit(FatalIOError);
561  }
562 
563  // Analyse the fileName for any processor subset. Note: this
564  // should really be part of filePath() which should return
565  // both file and index in file.
566  fileName path, procDir, local;
567  label groupStart, groupSize, nProcs;
568  splitProcessorPath
569  (
570  fName,
571  path,
572  procDir,
573  local,
574  groupStart,
575  groupSize,
576  nProcs
577  );
578  if (groupStart != -1 && groupSize > 0)
579  {
580  proci = proci-groupStart;
581  }
582 
583  // Read data and return as stream
584  return decomposedBlockData::readBlock(proci, isPtr(), io);
585  }
586 }
587 
588 
590 (
591  regIOobject& io,
592  const bool masterOnly,
593  const IOstream::streamFormat format,
594  const word& typeName
595 ) const
596 {
597  bool ok = true;
598  if (Pstream::master() || !masterOnly)
599  {
600  if (debug)
601  {
602  Pout<< "uncollatedFileOperation::read :"
603  << " Reading object " << io.objectPath()
604  << " from file " << endl;
605  }
606 
607  // Set flag for e.g. codeStream
608  const bool oldGlobal = io.globalObject();
609  io.globalObject() = masterOnly;
610  // If codeStream originates from dictionary which is
611  // not IOdictionary we have a problem so use global
612  const bool oldFlag = regIOobject::masterOnlyReading;
613  regIOobject::masterOnlyReading = masterOnly;
614 
615  // Read file
616  ok = io.readData(io.readStream(typeName));
617  io.close();
618 
619  // Restore flags
620  io.globalObject() = oldGlobal;
622  }
623 
624  if (masterOnly && Pstream::parRun())
625  {
626  // Master reads headerclassname from file. Make sure this gets
627  // transferred as well as contents.
629  Pstream::scatter(io.note());
630 
631  // Get my communication order
632  const List<Pstream::commsStruct>& comms =
633  (
637  );
638  const Pstream::commsStruct& myComm = comms[Pstream::myProcNo()];
639 
640  // Reveive from up
641  if (myComm.above() != -1)
642  {
643  IPstream fromAbove
644  (
646  myComm.above(),
647  0,
650  format
651  );
652  ok = io.readData(fromAbove);
653  }
654 
655  // Send to my downstairs neighbours
656  forAll(myComm.below(), belowI)
657  {
658  OPstream toBelow
659  (
661  myComm.below()[belowI],
662  0,
665  format
666  );
667  bool okWrite = io.writeData(toBelow);
668  ok = ok && okWrite;
669  }
670  }
671  return ok;
672 }
673 
674 
677 (
678  const fileName& filePath
679 ) const
680 {
681  return autoPtr<ISstream>(new IFstream(filePath));
682 }
683 
684 
687 (
688  const fileName& pathName,
692  const bool valid
693 ) const
694 {
695  return autoPtr<Ostream>(new OFstream(pathName, fmt, ver, cmp));
696 }
697 
698 
699 // ************************************************************************* //
time_t lastModified(const fileName &, const bool followLink=true)
Return time of last file modification.
Definition: POSIX.C:588
const labelList & below() const
Definition: UPstream.H:130
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:428
virtual bool exists(const fileName &, const bool checkGzip=true, const bool followLink=true) const
Does the name exist (as DIRECTORY or FILE) in the file system?
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
bool mv(const fileName &src, const fileName &dst, const bool followLink=false)
Rename src to dst.
Definition: POSIX.C:937
const word & name() const
Return name.
Definition: IOobject.H:297
A class for handling file names.
Definition: fileName.H:69
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
error FatalError
virtual bool mv(const fileName &src, const fileName &dst, const bool followLink=false) const
Rename src to dst.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:319
virtual bool chMod(const fileName &, const mode_t) const
Set the file mode.
off_t fileSize(const fileName &, const bool followLink=true)
Return size of file.
Definition: POSIX.C:566
Output to file stream.
Definition: OFstream.H:82
static const fileName null
An empty fileName.
Definition: fileName.H:97
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
Definition: UPstream.H:427
virtual mode_t mode(const fileName &, const bool followLink=true) const
Return the file mode.
static int nProcsSimpleSum
Number of processors at which the sum algorithm changes from linear.
Definition: UPstream.H:269
virtual fileNameList readObjects(const objectRegistry &db, const fileName &instance, const fileName &local, word &newInstance) const
Search directory for objects. Used in IOobjectList.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:256
bool cp(const fileName &src, const fileName &dst, const bool followLink=true)
Copy, recursively if necessary, the source to the destination.
Definition: POSIX.C:737
static bool master(const label communicator=0)
Am I the master process.
Definition: UPstream.H:421
virtual bool readHeader(IOobject &, const fileName &, const word &typeName) const
Read object header from supplied file.
virtual double highResLastModified(const fileName &, const bool followLink=true) const
Return time of last file modification.
virtual bool read(regIOobject &, const bool masterOnly, const IOstream::streamFormat format, const word &typeName) const
Top-level read.
word format(conversionProperties.lookup("format"))
static int & msgType()
Message tag of standard messages.
Definition: UPstream.H:474
virtual bool mkDir(const fileName &, mode_t=0777) const
Make directory.
static label worldComm
Default communicator (all processors)
Definition: UPstream.H:278
virtual fileName filePath(const bool checkGlobal, const IOobject &, const word &typeName) const
Search for an object. checkGlobal : also check undecomposed case.
static const List< commsStruct > & linearCommunication(const label communicator=0)
Communication schedule for linear all-to-master (proc 0)
Definition: UPstream.H:457
bool mvBak(const fileName &, const std::string &ext="bak")
Rename to a corresponding backup file.
Definition: POSIX.C:966
Macros for easy insertion into run-time selection tables.
addNamedToRunTimeSelectionTable(fileOperationInitialise, collatedFileOperationInitialise, word, collated)
virtual bool isFile(const fileName &, const bool checkGzip=true, const bool followLink=true) const
Does the name exist as a FILE in the file system?
virtual bool rmDir(const fileName &) const
Remove a directory and its contents.
Input inter-processor communications stream.
Definition: IPstream.H:50
addToRunTimeSelectionTable(fileOperation, collatedFileOperation, word)
bool readHeader(Istream &)
Read header.
string & note()
Return non-constant access to the optional note.
Definition: IOobject.H:315
virtual fileNameList readDir(const fileName &, const fileName::Type=fileName::FILE, const bool filtergz=true, const bool followLink=true) const
Read a directory and return the entries as a string list.
virtual bool isDir(const fileName &, const bool followLink=true) const
Does the name exist as a DIRECTORY in the file system?
virtual autoPtr< ISstream > NewIFstream(const fileName &) const
Generate an ISstream that reads a file.
virtual autoPtr< Ostream > NewOFstream(const fileName &pathname, IOstream::streamFormat format=IOstream::ASCII, IOstream::versionNumber version=IOstream::currentVersion, IOstream::compressionType compression=IOstream::UNCOMPRESSED, const bool valid=true) const
Generate an Ostream that writes a file.
void close()
Close Istream.
bool isDir(const fileName &, const bool followLink=true)
Does the name exist as a DIRECTORY in the file system?
Definition: POSIX.C:528
A class for handling words, derived from string.
Definition: word.H:59
bool & globalObject()
Is object same for all processors.
Definition: IOobject.H:345
virtual bool cp(const fileName &src, const fileName &dst, const bool followLink=true) const
Copy, recursively if necessary, the source to the destination.
mode_t mode(const fileName &, const bool followLink=true)
Return the file mode.
Definition: POSIX.C:459
word name() const
Return file name (part beyond last /)
Definition: fileName.C:179
streamFormat
Enumeration for the format of data in the stream.
Definition: IOstream.H:86
virtual off_t fileSize(const fileName &, const bool followLink=true) const
Return size of file.
static const List< commsStruct > & treeCommunication(const label communicator=0)
Communication schedule for tree all-to-master (proc 0)
Definition: UPstream.H:466
virtual fileName dirPath(const bool checkGlobal, const IOobject &) const
Search for a directory. checkGlobal : also check undecomposed.
virtual time_t lastModified(const fileName &, const bool followLink=true) const
Return time of last file modification.
virtual bool rm(const fileName &) const
Remove a file, returning true if successful otherwise false.
bool valid() const
Return true if the autoPtr valid (ie, the pointer is set)
Definition: autoPtrI.H:83
Structure for communicating between processors.
Definition: UPstream.H:76
bool ln(const fileName &src, const fileName &dst)
Create a softlink. dst should not exist. Returns true if successful.
Definition: POSIX.C:896
static void scatter(const List< commsStruct > &comms, T &Value, const int tag, const label comm)
Scatter data. Distribute without modification. Reverse of gather.
compressionType
Enumeration for the format of data in the stream.
Definition: IOstream.H:193
virtual bool ln(const fileName &src, const fileName &dst) const
Create a softlink. dst should not exist. Returns true if.
bool rmDir(const fileName &)
Remove a directory and its contents.
Definition: POSIX.C:1032
bool isFile(const fileName &, const bool checkGzip=true, const bool followLink=true)
Does the name exist as a FILE in the file system?
Definition: POSIX.C:543
const Time & time() const
Return time.
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
Input from file stream.
Definition: IFstream.H:81
Output inter-processor communications stream.
Definition: OPstream.H:50
bool mkDir(const fileName &, mode_t=0777)
Make a directory and return an error if it could not be created.
Definition: POSIX.C:289
fileName::Type type(const fileName &, const bool followLink=true)
Return the file type: DIRECTORY or FILE.
Definition: POSIX.C:481
uncollatedFileOperation(const bool verbose)
Construct null.
static bool masterOnlyReading
To flag master-only reading of objects.
Definition: regIOobject.H:78
An instant of time. Contains the time value and name.
Definition: instant.H:66
virtual autoPtr< ISstream > readStream(regIOobject &, const fileName &, const word &typeName, const bool procValid=true) const
Reads header for regIOobject and returns an ISstream.
static autoPtr< ISstream > readBlock(const label blocki, Istream &is, IOobject &headerIO)
Read selected block (non-seeking) + header information.
static bool & parRun()
Is this a parallel run?
Definition: UPstream.H:397
static label nProcs(const label communicator=0)
Number of processes in parallel run.
Definition: UPstream.H:409
static bool readMasterHeader(IOobject &, Istream &)
Read header. Call only on master.
virtual bool mvBak(const fileName &, const std::string &ext="bak") const
Rename to a corresponding backup file.
virtual bool readData(Istream &)
Virtual readData function.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Definition: error.H:331
prefixOSstream Pout(cout, "Pout")
Definition: IOstreams.H:53
bool chMod(const fileName &, const mode_t)
Set the file mode.
Definition: POSIX.C:445
virtual fileNameList readObjects(const objectRegistry &db, const fileName &instance, const fileName &local, word &newInstance) const
Search directory for objects. Used in IOobjectList.
Version number type.
Definition: IOstream.H:96
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Definition: regIOobject.H:65
fileNameList readDir(const fileName &, const fileName::Type=fileName::FILE, const bool filtergz=true, const bool followLink=true)
Read a directory and return the entries as a string list.
Definition: POSIX.C:635
messageStream Info
fileName path() const
Return directory path name (part before last /)
Definition: fileName.C:249
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
defineTypeNameAndDebug(collatedFileOperation, 0)
bool rm(const fileName &)
Remove a file, returning true if successful otherwise false.
Definition: POSIX.C:1008
Registry of regIOobjects.
virtual bool writeData(Ostream &) const =0
Pure virtual writaData function.
word findInstancePath(const fileName &path, const instant &) const
Search the case for the time directory path.
Definition: Time.C:679
Dummy stream for input. Aborts at any attempt to read from it.
Definition: dummyISstream.H:47
const word & headerClassName() const
Return name of the class name read from header.
Definition: IOobject.H:303
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:92
fileName objectPath() const
Return complete path + object name.
Definition: IOobject.H:418
virtual fileName::Type type(const fileName &, const bool followLink=true) const
Return the file type: DIRECTORY, FILE or LINK.
bool exists(const fileName &, const bool checkGzip=true, const bool followLink=true)
Does the name exist (as DIRECTORY or FILE) in the file system?
Definition: POSIX.C:509
Type
Enumerations to handle file types and modes.
Definition: fileName.H:82
Namespace for OpenFOAM.
double highResLastModified(const fileName &, const bool followLink=true)
Return time of last file modification.
Definition: POSIX.C:610
IOerror FatalIOError
#define InfoInFunction
Report an information message using Foam::Info.