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-2019 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  InfoHeader << "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 checkVariants,
210  const bool followLink
211 ) const
212 {
213  return Foam::mode(fName, checkVariants, followLink);
214 }
215 
216 
218 (
219  const fileName& fName,
220  const bool checkVariants,
221  const bool followLink
222 ) const
223 {
224  return Foam::type(fName, checkVariants, followLink);
225 }
226 
227 
229 (
230  const fileName& fName,
231  const bool checkVariants,
232  const bool followLink
233 ) const
234 {
235  return Foam::exists(fName, checkVariants, followLink);
236 }
237 
238 
240 (
241  const fileName& fName,
242  const bool followLink
243 ) const
244 {
245  return Foam::isDir(fName, followLink);
246 }
247 
248 
250 (
251  const fileName& fName,
252  const bool checkVariants,
253  const bool followLink
254 ) const
255 {
256  return Foam::isFile(fName, checkVariants, followLink);
257 }
258 
259 
261 (
262  const fileName& fName,
263  const bool checkVariants,
264  const bool followLink
265 ) const
266 {
267  return Foam::fileSize(fName, checkVariants, followLink);
268 }
269 
270 
272 (
273  const fileName& fName,
274  const bool checkVariants,
275  const bool followLink
276 ) const
277 {
278  return Foam::lastModified(fName, checkVariants, followLink);
279 }
280 
281 
283 (
284  const fileName& fName,
285  const bool checkVariants,
286  const bool followLink
287 ) const
288 {
289  return Foam::highResLastModified(fName, checkVariants, followLink);
290 }
291 
292 
294 (
295  const fileName& fName,
296  const std::string& ext
297 ) const
298 {
299  return Foam::mvBak(fName, ext);
300 }
301 
302 
304 (
305  const fileName& fName
306 ) const
307 {
308  return Foam::rm(fName);
309 }
310 
311 
313 (
314  const fileName& dir
315 ) const
316 {
317  return Foam::rmDir(dir);
318 }
319 
320 
322 (
323  const fileName& dir,
324  const fileType type,
325  const bool filtergz,
326  const bool followLink
327 ) const
328 {
329  return Foam::readDir(dir, type, filtergz, followLink);
330 }
331 
332 
334 (
335  const fileName& src,
336  const fileName& dst,
337  const bool followLink
338 ) const
339 {
340  return Foam::cp(src, dst, followLink);
341 }
342 
343 
345 (
346  const fileName& src,
347  const fileName& dst
348 ) const
349 {
350  return Foam::ln(src, dst);
351 }
352 
353 
355 (
356  const fileName& src,
357  const fileName& dst,
358  const bool followLink
359 ) const
360 {
361  return Foam::mv(src, dst, followLink);
362 }
363 
364 
366 (
367  const bool checkGlobal,
368  const IOobject& io,
369  const word& typeName
370 ) const
371 {
372  if (debug)
373  {
374  Pout<< "uncollatedFileOperation::filePath :"
375  << " objectPath:" << io.objectPath()
376  << " checkGlobal:" << checkGlobal << endl;
377  }
378 
379  fileName objPath(filePathInfo(checkGlobal, true, io));
380 
381  if (debug)
382  {
383  Pout<< "uncollatedFileOperation::filePath :"
384  << " Returning from file searching:" << endl
385  << " objectPath:" << io.objectPath() << endl
386  << " filePath :" << objPath << endl << endl;
387  }
388  return objPath;
389 }
390 
391 
393 (
394  const bool checkGlobal,
395  const IOobject& io
396 ) const
397 {
398  if (debug)
399  {
400  Pout<< "uncollatedFileOperation::dirPath :"
401  << " objectPath:" << io.objectPath()
402  << " checkGlobal:" << checkGlobal << endl;
403  }
404 
405  fileName objPath(filePathInfo(checkGlobal, false, io));
406 
407  if (debug)
408  {
409  Pout<< "uncollatedFileOperation::dirPath :"
410  << " Returning from directory searching:" << endl
411  << " objectPath:" << io.objectPath() << endl
412  << " dirPath :" << objPath << endl << endl;
413  }
414  return objPath;
415 }
416 
417 
419 (
420  const objectRegistry& db,
421  const fileName& instance,
422  const fileName& local,
423  word& newInstance
424 ) const
425 {
426  if (debug)
427  {
428  Pout<< "uncollatedFileOperation::readObjects :"
429  << " db:" << db.objectPath()
430  << " instance:" << instance << endl;
431  }
432 
433  //- Use non-time searching version
434  fileNameList objectNames
435  (
436  fileOperation::readObjects(db, instance, local, newInstance)
437  );
438 
439  if (newInstance.empty())
440  {
441  // Find similar time
442  fileName newInst = db.time().findInstancePath(instant(instance));
443  if (!newInst.empty() && newInst != instance)
444  {
445  // Try with new time
446  objectNames = fileOperation::readObjects
447  (
448  db,
449  newInst,
450  local,
451  newInstance
452  );
453  }
454  }
455 
456  if (debug)
457  {
458  Pout<< "uncollatedFileOperation::readObjects :"
459  << " newInstance:" << newInstance
460  << " objectNames:" << objectNames << endl;
461  }
462 
463  return objectNames;
464 }
465 
466 
468 (
469  IOobject& io,
470  const fileName& fName,
471  const word& typeName
472 ) const
473 {
474  if (debug)
475  {
476  Pout<< "uncollatedFileOperation::readHeader :"
477  << " fName:" << fName
478  << " typeName:" << typeName << endl;
479  }
480  if (fName.empty())
481  {
482  if (IOobject::debug)
483  {
485  << "file " << io.objectPath() << " could not be opened"
486  << endl;
487  }
488 
489  return false;
490  }
491 
492  autoPtr<ISstream> isPtr(NewIFstream(fName));
493 
494  if (!isPtr.valid() || !isPtr->good())
495  {
496  return false;
497  }
498 
499  bool ok = io.readHeader(isPtr());
500 
501  if (io.headerClassName() == decomposedBlockData::typeName)
502  {
503  // Read the header inside the container (master data)
504  ok = decomposedBlockData::readMasterHeader(io, isPtr());
505  }
506 
507  if (debug)
508  {
509  Pout<< "uncollatedFileOperation::readHeader :"
510  << " for fName:" << fName
511  << " ok:" << ok
512  << " headerClassName:" << io.headerClassName() << endl;
513  }
514 
515  return ok;
516 }
517 
518 
521 (
522  regIOobject& io,
523  const fileName& fName,
524  const word& typeName,
525  const bool read
526 ) const
527 {
528  autoPtr<ISstream> isPtr;
529 
530  if (!read)
531  {
532  isPtr = autoPtr<ISstream>(new dummyISstream());
533  return isPtr;
534  }
535 
536  if (fName.empty())
537  {
539  << "cannot find file " << io.objectPath()
540  << exit(FatalError);
541  }
542 
543  isPtr = NewIFstream(fName);
544 
545  if (!isPtr.valid() || !isPtr->good())
546  {
548  (
549  "uncollatedFileOperation::readStream()",
550  __FILE__,
551  __LINE__,
552  fName,
553  0
554  ) << "cannot open file"
555  << exit(FatalIOError);
556  }
557  else if (!io.readHeader(isPtr()))
558  {
559  FatalIOErrorInFunction(isPtr())
560  << "problem while reading header for object " << io.name()
561  << exit(FatalIOError);
562  }
563 
564  if (io.headerClassName() != decomposedBlockData::typeName)
565  {
566  return isPtr;
567  }
568  else
569  {
570  // Analyse the objectpath to find out the processor we're trying
571  // to access
572  label proci = detectProcessorPath(io.objectPath());
573 
574  if (proci == -1)
575  {
576  FatalIOErrorInFunction(isPtr())
577  << "could not detect processor number"
578  << " from objectPath:" << io.objectPath()
579  << " fName:" << fName
580  << exit(FatalIOError);
581  }
582 
583  // Analyse the fileName for any processor subset. Note: this
584  // should really be part of filePath() which should return
585  // both file and index in file.
586  fileName path, procDir, local;
587  label groupStart, groupSize, nProcs;
588  splitProcessorPath
589  (
590  fName,
591  path,
592  procDir,
593  local,
594  groupStart,
595  groupSize,
596  nProcs
597  );
598  if (groupStart != -1 && groupSize > 0)
599  {
600  proci = proci-groupStart;
601  }
602 
603  // Read data and return as stream
604  return decomposedBlockData::readBlock(proci, isPtr(), io);
605  }
606 }
607 
608 
610 (
611  regIOobject& io,
612  const bool masterOnly,
613  const IOstream::streamFormat format,
614  const word& typeName
615 ) const
616 {
617  bool ok = true;
618  if (Pstream::master() || !masterOnly)
619  {
620  if (debug)
621  {
622  Pout<< "uncollatedFileOperation::read :"
623  << " Reading object " << io.objectPath()
624  << " from file " << endl;
625  }
626 
627  // Read file
628  ok = io.readData(io.readStream(typeName));
629  io.close();
630 
631  if (debug)
632  {
633  Pout<< "uncollatedFileOperation::read :"
634  << " Done reading object " << io.objectPath()
635  << " from file " << endl;
636  }
637  }
638 
639  if (masterOnly && Pstream::parRun())
640  {
641  // Master reads headerclassname from file. Make sure this gets
642  // transferred as well as contents.
644  Pstream::scatter(io.note());
645 
646  // Get my communication order
647  const List<Pstream::commsStruct>& comms =
648  (
652  );
653  const Pstream::commsStruct& myComm = comms[Pstream::myProcNo()];
654 
655  // Receive from up
656  if (myComm.above() != -1)
657  {
658  IPstream fromAbove
659  (
661  myComm.above(),
662  0,
665  format
666  );
667  ok = io.readData(fromAbove);
668  }
669 
670  // Send to my downstairs neighbours
671  forAll(myComm.below(), belowI)
672  {
673  OPstream toBelow
674  (
676  myComm.below()[belowI],
677  0,
680  format
681  );
682  bool okWrite = io.writeData(toBelow);
683  ok = ok && okWrite;
684  }
685  }
686  return ok;
687 }
688 
689 
692 (
693  const fileName& filePath
694 ) const
695 {
696  return autoPtr<ISstream>(new IFstream(filePath));
697 }
698 
699 
702 (
703  const fileName& pathName,
707  const bool write
708 ) const
709 {
710  return autoPtr<Ostream>(new OFstream(pathName, fmt, ver, cmp));
711 }
712 
713 
714 // ************************************************************************* //
time_t lastModified(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return time of last file modification.
Definition: POSIX.C:604
const labelList & below() const
Definition: UPstream.H:130
bool exists(const fileName &, const bool checkVariants=true, const bool followLink=true)
Does the name exist (as directory or file) in the file system?
Definition: POSIX.C:520
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:434
mode_t mode(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file mode.
Definition: POSIX.C:461
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:952
const word & name() const
Return name.
Definition: IOobject.H:295
A class for handling file names.
Definition: fileName.H:79
virtual fileNameList readDir(const fileName &, const fileType=fileType::file, const bool filtergz=true, const bool followLink=true) const
Read a directory and return the entries as a string list.
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.
virtual autoPtr< Ostream > NewOFstream(const fileName &pathname, IOstream::streamFormat format=IOstream::ASCII, IOstream::versionNumber version=IOstream::currentVersion, IOstream::compressionType compression=IOstream::UNCOMPRESSED, const bool write=true) const
Generate an Ostream that writes a file.
bool isFile(const fileName &, const bool checkVariants=true, const bool followLink=true)
Does the name exist as a file in the file system?
Definition: POSIX.C:555
#define InfoHeader
Report write to Foam::Info if the local log switch is true.
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:429
virtual double highResLastModified(const fileName &, const bool checkVariants=true, const bool followLink=true) const
Return time of last file modification.
static int nProcsSimpleSum
Number of processors at which the sum algorithm changes from linear.
Definition: UPstream.H:269
virtual off_t fileSize(const fileName &, const bool checkVariants=true, const bool followLink=true) const
Return size of file.
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:753
static bool master(const label communicator=0)
Am I the master process.
Definition: UPstream.H:423
virtual bool readHeader(IOobject &, const fileName &, const word &typeName) const
Read object header from supplied file.
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:476
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:459
bool mvBak(const fileName &, const std::string &ext="bak")
Rename to a corresponding backup file.
Definition: POSIX.C:980
virtual fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true) const
Return the file type: directory, file or link.
Macros for easy insertion into run-time selection tables.
addNamedToRunTimeSelectionTable(fileOperationInitialise, collatedFileOperationInitialise, word, collated)
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)
virtual autoPtr< ISstream > readStream(regIOobject &, const fileName &, const word &typeName, const bool read=true) const
Reads header for regIOobject and returns an ISstream.
bool readHeader(Istream &)
Read header.
string & note()
Return non-constant access to the optional note.
Definition: IOobject.H:313
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.
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:539
A class for handling words, derived from string.
Definition: word.H:59
virtual bool cp(const fileName &src, const fileName &dst, const bool followLink=true) const
Copy, recursively if necessary, the source to the destination.
word name() const
Return file name (part beyond last /)
Definition: fileName.C:183
streamFormat
Enumeration for the format of data in the stream.
Definition: IOstream.H:86
static const List< commsStruct > & treeCommunication(const label communicator=0)
Communication schedule for tree all-to-master (proc 0)
Definition: UPstream.H:468
virtual fileName dirPath(const bool checkGlobal, const IOobject &) const
Search for a directory. checkGlobal : also check undecomposed.
fileType
Enumeration of file types.
Definition: fileName.H:66
fileNameList readDir(const fileName &, const fileType=fileType::file, const bool filterVariants=true, const bool followLink=true)
Read a directory and return the entries as a string list.
Definition: POSIX.C:662
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:912
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:1051
virtual time_t lastModified(const fileName &, const bool checkVariants=true, const bool followLink=true) const
Return time of last file modification.
const Time & time() const
Return time.
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:290
uncollatedFileOperation(const bool verbose)
Construct null.
virtual mode_t mode(const fileName &, const bool checkVariants=true, const bool followLink=true) const
Return the file mode.
An instant of time. Contains the time value and name.
Definition: instant.H:66
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:399
static label nProcs(const label communicator=0)
Number of processes in parallel run.
Definition: UPstream.H:411
static bool readMasterHeader(IOobject &, Istream &)
Read header. Call only on master.
virtual bool exists(const fileName &, const bool checkVariants=true, const bool followLink=true) const
Does the name exist (as directory or file) in the file system?
virtual bool mvBak(const fileName &, const std::string &ext="bak") const
Rename to a corresponding backup file.
virtual bool readData(Istream &)
Virtual readData function.
double highResLastModified(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return time of last file modification.
Definition: POSIX.C:632
#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:446
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488
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:55
fileName path() const
Return directory path name (part before last /)
Definition: fileName.C:253
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
off_t fileSize(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return size of file.
Definition: POSIX.C:576
defineTypeNameAndDebug(collatedFileOperation, 0)
bool rm(const fileName &)
Remove a file, returning true if successful otherwise false.
Definition: POSIX.C:1021
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:301
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:404
virtual bool isFile(const fileName &, const bool checkVariants=true, const bool followLink=true) const
Does the name exist as a FILE in the file system?
Namespace for OpenFOAM.
fileName path(UMean.rootPath()/UMean.caseName()/functionObjects::writeFile::outputPrefix/"graphs"/UMean.instance())
IOerror FatalIOError
#define InfoInFunction
Report an information message using Foam::Info.