masterUncollatedFileOperation.H
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2017 OpenFOAM Foundation
9 Copyright (C) 2019-2022 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::fileOperations::masterUncollatedFileOperation
29
30Description
31 fileOperations that performs all file operations on the master processor.
32 Requires the calls to be parallel synchronised!
33
34 Limitations
35 - no /processor in filename
36 - no /uniform/ in the filename
37
38 The main logic is in ::filePath which returns a
39 - same path on all processors. This can either be a global file
40 (system/controlDict, processorXXX/0/uniform/) or a collated file
41 (processors/0/p)
42 - same path on all processors of the local communicator
43 (processors4_0-1/0/p)
44 - different path on all processors (processor0/0/p)
45
46 system/controlDict:
47 filePath worldmaster: <globalRoot>/system/controlDict
48 localmaster: ,,
49 slave : ,,
50
51 processor0/uniform/time
52 filePath worldmaster: <globalRoot>/processorXXX/uniform/time
53 localmaster: ,,
54 slave : ,,
55
56 processors0/0/p
57 processors10/0/p
58 processors10_2-4/0/p
59
60\*---------------------------------------------------------------------------*/
61
62#ifndef Foam_fileOperations_masterUncollatedFileOperation_H
63#define Foam_fileOperations_masterUncollatedFileOperation_H
64
65#include "fileOperation.H"
66#include "OSspecific.H"
67#include "HashPtrTable.H"
68#include "DynamicList.H"
69#include "List.H"
71
72// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
73
74namespace Foam
75{
76
77// Forward Declarations
78class PstreamBuffers;
79
80namespace fileOperations
81{
82
83/*---------------------------------------------------------------------------*\
84 Class masterUncollatedFileOperation Declaration
85\*---------------------------------------------------------------------------*/
88:
89 public fileOperation
90{
91protected:
92
93 // Protected Data
94
95 //- Any communicator allocated by me
96 const label myComm_;
97
98 //- Cached times for a given directory
100
101
102 // Protected Operation Functors
104 class mkDirOp
105 {
106 const mode_t mode_;
107 public:
108 mkDirOp(const mode_t mode)
109 :
110 mode_(mode)
111 {}
113 bool operator()(const fileName& f) const
114 {
115 return Foam::mkDir(f, mode_);
116 }
117 };
119 class chModOp
120 {
121 const mode_t mode_;
122 public:
123 chModOp(const mode_t mode)
124 :
125 mode_(mode)
126 {}
128 bool operator()(const fileName& f) const
129 {
130 return Foam::chMod(f, mode_);
131 }
132 };
134 class modeOp
135 {
136 const bool followLink_;
137 public:
138 modeOp(const bool followLink)
139 :
140 followLink_(followLink)
141 {}
143 mode_t operator()(const fileName& f) const
144 {
145 return Foam::mode(f, followLink_);
146 }
147 };
149 class typeOp
150 {
151 const bool followLink_;
152 public:
153 typeOp(const bool followLink)
154 :
155 followLink_(followLink)
156 {}
157
158 // Returns label not fileName::Type for reductions
159 label operator()(const fileName& f) const
160 {
161 return Foam::type(f, followLink_);
162 }
163 };
165 class existsOp
166 {
167 const bool checkGzip_;
168 const bool followLink_;
169 public:
170 existsOp(const bool checkGzip, const bool followLink)
171 :
172 checkGzip_(checkGzip),
173 followLink_(followLink)
174 {}
176 bool operator()(const fileName& f) const
177 {
178 return Foam::exists(f, checkGzip_, followLink_);
179 }
180 };
182 class isDirOp
183 {
184 const bool followLink_;
185 public:
186 isDirOp(const bool followLink)
187 :
188 followLink_(followLink)
189 {}
191 bool operator()(const fileName& f) const
192 {
193 return Foam::isDir(f, followLink_);
194 }
195 };
197 class isFileOp
198 {
199 const bool checkGzip_;
200 const bool followLink_;
201 public:
202 isFileOp(const bool checkGzip, const bool followLink)
203 :
204 checkGzip_(checkGzip),
205 followLink_(followLink)
206 {}
208 bool operator()(const fileName& f) const
209 {
210 return Foam::isFile(f, checkGzip_, followLink_);
211 }
212 };
214 class fileSizeOp
215 {
216 const bool followLink_;
217 public:
218 fileSizeOp(const bool followLink)
219 :
220 followLink_(followLink)
221 {}
223 off_t operator()(const fileName& f) const
224 {
225 return Foam::fileSize(f, followLink_);
226 }
227 };
229 class lastModifiedOp
230 {
231 const bool followLink_;
232 public:
233 lastModifiedOp(const bool followLink)
234 :
235 followLink_(followLink)
236 {}
238 time_t operator()(const fileName& f) const
239 {
240 return Foam::lastModified(f, followLink_);
241 }
242 };
245 {
246 const bool followLink_;
247 public:
248 highResLastModifiedOp(const bool followLink)
249 :
250 followLink_(followLink)
251 {}
253 double operator()(const fileName& f) const
254 {
255 return Foam::highResLastModified(f, followLink_);
256 }
257 };
259 class mvBakOp
260 {
261 std::string ext_;
262 public:
263 mvBakOp(const std::string& ext)
264 :
265 ext_(ext)
266 {}
268 bool operator()(const fileName& f) const
269 {
270 return Foam::mvBak(f, ext_);
271 }
272 };
274 class rmOp
275 {
276 public:
277 bool operator()(const fileName& f) const
278 {
279 return Foam::rm(f);
280 }
281 };
283 class rmDirOp
284 {
285 bool silent_;
286 public:
287 rmDirOp(const bool silent=false)
288 :
289 silent_(silent)
290 {}
292 bool operator()(const fileName& f) const
293 {
294 return Foam::rmDir(f, silent_);
295 }
296 };
298 class cpOp
299 {
300 const bool followLink_;
301 public:
302 cpOp(const bool followLink)
303 :
304 followLink_(followLink)
305 {}
307 bool operator()(const fileName& src, const fileName& dest) const
308 {
309 return Foam::cp(src, dest, followLink_);
310 }
311 };
313 class lnOp
314 {
315 public:
316 bool operator()(const fileName& src, const fileName& dest) const
317 {
318 return Foam::ln(src, dest);
319 }
320 };
322 class mvOp
323 {
324 const bool followLink_;
325 public:
326 mvOp(const bool followLink)
327 :
328 followLink_(followLink)
329 {}
331 bool operator()(const fileName& src, const fileName& dest) const
332 {
333 return Foam::mv(src, dest, followLink_);
334 }
335 };
337 class fileOrNullOp
338 {
339 const bool isFile_;
340 public:
341 fileOrNullOp(const bool isFile)
342 :
343 isFile_(isFile)
344 {}
346 const fileName& operator()(const fileName& f) const
347 {
348 return
349 (
350 (isFile_ ? Foam::isFile(f) : Foam::isDir(f))
351 ? f
353 );
354 }
355 };
357 class readDirOp
358 {
359 const fileName::Type type_;
360 const bool filtergz_;
361 const bool followLink_;
362 public:
364 (
365 const fileName::Type type,
366 const bool filtergz,
367 const bool followLink
368 )
369 :
370 type_(type),
371 filtergz_(filtergz),
372 followLink_(followLink)
373 {}
375 fileNameList operator()(const fileName& f) const
376 {
377 return Foam::readDir(f, type_, filtergz_, followLink_);
378 }
379 };
380
381
382 // Private Member Functions
383
384 //- Get the list of processors that are part of this communicator
385 static labelList subRanks(const label n);
386
387 template<class Type>
388 Type scatterList(const UList<Type>&, const int, const label comm) const;
389
390 template<class Type, class FileOp>
391 Type masterOp
392 (
393 const fileName& fName,
394 const FileOp& fop,
395 const int tag,
396 const label comm
397 ) const;
398
399 template<class Type, class FileOp>
400 Type masterOp
401 (
402 const fileName& src,
403 const fileName& dest,
404 const FileOp& fop,
405 const int tag,
406 const label comm
407 ) const;
408
409 //- Equivalent of Time::findInstance
411 (
412 const instantList& timeDirs,
413 const instant& t
414 );
415
416 //- Search (locally!) for object; return info on how it was found.
417 // Does not do any parallel communication.
418 // checkGlobal : also check undecomposed case
419 // isFile : true:check for file false:check for directory
420 // searchType : how was found
421 // processorsDir : name of processor directory
422 // instance : instance
423 virtual fileName filePathInfo
424 (
425 const bool checkGlobal,
426 const bool isFile,
427 const IOobject&,
428 const bool search,
429 pathType& searchType,
431 word& instance
432 ) const;
433
434 //- Construct filePath
436 (
437 const IOobject&,
438 const pathType& searchType,
439 const word& processorsDir,
440 const word& instancePath
441 ) const;
442
443 //- Read file contents and send to processors.
444 // Handles compressed or uncompressed files
445 static void readAndSend
446 (
447 const fileName& filePath,
448 const labelUList& procs,
449 PstreamBuffers& pBufs
450 );
451
452 //- Read files on comms master
454 (
455 IOobject& io,
456 const label comm,
457 const bool uniform, // on comms master only
458 const fileNameList& filePaths, // on comms master only
459 const boolList& procValid // on comms master only
460 );
461
462 //- Helper: check IO for local existence. Like filePathInfo but
463 // without parent searchign and instance searching
464 bool exists(const dirIndexList&, IOobject& io) const;
465
466
467public:
468
469 //- Runtime type information
470 TypeName("masterUncollated");
471
472
473 // Static Data
474
475 //- Max size of parallel communications. Switches from non-blocking
476 // to scheduled when reading/writing files. Read as float to enable
477 // easy specification of large sizes.
478 static float maxMasterFileBufferSize;
479
480
481 // Constructors
482
483 //- Default construct
484 explicit masterUncollatedFileOperation(bool verbose);
485
486 //- Construct from communicator
487 masterUncollatedFileOperation(const label comm, bool verbose);
488
489
490 //- Destructor
492
493
494 // Member Functions
495
496 // OSSpecific equivalents
497
498 //- Make directory
499 virtual bool mkDir(const fileName&, mode_t=0777) const;
500
501 //- Set the file mode
502 virtual bool chMod(const fileName&, const mode_t) const;
503
504 //- Return the file mode
505 virtual mode_t mode
506 (
507 const fileName&,
508 const bool followLink = true
509 ) const;
510
511 //- Return the file type: DIRECTORY, FILE or SYMLINK
512 virtual fileName::Type type
513 (
514 const fileName&,
515 const bool followLink = true
516 ) const;
517
518 //- Does the name exist (as DIRECTORY or FILE) in the file system?
519 // Optionally enable/disable check for gzip file.
520 virtual bool exists
521 (
522 const fileName&,
523 const bool checkGzip=true,
524 const bool followLink = true
525 ) const;
526
527 //- Does the name exist as a DIRECTORY in the file system?
528 virtual bool isDir
529 (
530 const fileName&,
531 const bool followLink = true
532 ) const;
533
534 //- Does the name exist as a FILE in the file system?
535 // Optionally enable/disable check for gzip file.
536 virtual bool isFile
537 (
538 const fileName&,
539 const bool checkGzip=true,
540 const bool followLink = true
541 ) const;
542
543 //- Return size of file
544 virtual off_t fileSize
545 (
546 const fileName&,
547 const bool followLink = true
548 ) const;
549
550 //- Return time of last file modification
551 virtual time_t lastModified
552 (
553 const fileName&,
554 const bool followLink = true
555 ) const;
556
557 //- Return time of last file modification
558 virtual double highResLastModified
559 (
560 const fileName&,
561 const bool followLink = true
562 ) const;
563
564 //- Read a directory and return the entries as a string list
565 virtual fileNameList readDir
566 (
567 const fileName&,
569 const bool filtergz=true,
570 const bool followLink = true
571 ) const;
572
573 //- Copy, recursively if necessary, the source to the destination
574 virtual bool cp
575 (
576 const fileName& src,
577 const fileName& dst,
578 const bool followLink = true
579 ) const;
580
581 //- Create a softlink. dst should not exist. Returns true if
582 // successful.
583 virtual bool ln(const fileName& src, const fileName& dst) const;
584
585 //- Rename src to dst
586 virtual bool mv
587 (
588 const fileName& src,
589 const fileName& dst,
590 const bool followLink = false
591 ) const;
592
593 //- Rename to a corresponding backup file
594 // If the backup file already exists, attempt with
595 // "01" .. "99" suffix
596 virtual bool mvBak
597 (
598 const fileName&,
599 const std::string& ext = "bak"
600 ) const;
601
602 //- Remove a file, returning true if successful otherwise false
603 virtual bool rm(const fileName&) const;
604
605 //- Remove a directory and its contents
606 // \param silent do not report missing directory
607 virtual bool rmDir
608 (
609 const fileName& dir,
610 const bool silent = false
611 ) const;
612
613// //- Open a shared library. Return handle to library. Print error
614// // message if library cannot be loaded (check = true)
615// virtual void* dlOpen
616// (
617// const fileName& lib,
618// const bool check = true
619// ) const;
620
621
622 // (reg)IOobject functinality
623
624 //- Search for an object. checkGlobal : also check undecomposed case
625 virtual fileName filePath
626 (
627 const bool checkGlobal,
628 const IOobject& io,
629 const word& typeName,
630 const bool search
631 ) const;
632
633 //- Search for a directory. checkGlobal : also check undecomposed
634 // case
635 virtual fileName dirPath
636 (
637 const bool checkGlobal,
638 const IOobject& io,
639 const bool search
640 ) const;
641
642 //- Search directory for objects. Used in IOobjectList.
644 (
645 const objectRegistry& db,
646 const fileName& instance,
647 const fileName& local,
648 word& newInstance
649 ) const;
650
651 //- Read object header from supplied file
652 virtual bool readHeader
653 (
654 IOobject&,
655 const fileName&,
656 const word& typeName
657 ) const;
658
659 //- Reads header for regIOobject and returns an ISstream
660 // to read the contents.
662 (
664 const fileName&,
665 const word& typeName,
666 const bool valid = true
667 ) const;
668
669 //- Top-level read
670 virtual bool read
671 (
673 const bool masterOnly,
675 const word& typeName
676 ) const;
677
678 //- Writes a regIOobject (so header, contents and divider).
679 // Returns success state.
680 virtual bool writeObject
681 (
682 const regIOobject& io,
683 IOstreamOption streamOpt = IOstreamOption(),
684 const bool valid = true
685 ) const;
686
687 //- Generate an ISstream that reads a file
688 virtual autoPtr<ISstream> NewIFstream(const fileName&) const;
689
690 //- Generate an OSstream that writes a file
692 (
693 const fileName& pathname,
694 IOstreamOption streamOpt = IOstreamOption(),
695 const bool valid = true
696 ) const;
697
698
699 // File modification checking
700
701 //- Add watching of a file. Returns handle
702 virtual label addWatch(const fileName&) const;
703
704 //- Remove watch on a file (using handle)
705 virtual bool removeWatch(const label) const;
706
707 //- Find index (or -1) of file in list of handles
708 virtual label findWatch
709 (
710 const labelList& watchIndices,
711 const fileName&
712 ) const;
713
714 //- Helper: add watches for list of regIOobjects
715 virtual void addWatches(regIOobject&, const fileNameList&) const;
716
717 //- Get name of file being watched (using handle)
718 virtual fileName getFile(const label) const;
719
720 //- Update state of all files
721 virtual void updateStates
722 (
723 const bool masterOnly,
724 const bool syncPar
725 ) const;
726
727 //- Get current state of file (using handle)
728 virtual fileMonitor::fileState getState(const label) const;
729
730 //- Set current state of file (using handle) to unmodified
731 virtual void setUnmodified(const label) const;
732
733
734 // Other
735
736 //- Same file?
737 static bool uniformFile(const fileNameList&);
738
739 //- Get sorted list of times
740 virtual instantList findTimes(const fileName&, const word&) const;
741
742 //- Find instance where IOobject is.
743 // FatalError if it cannot be found and readOpt is
744 // (MUST_READ or MUST_READ_IF_MODIFIED).
745 // Otherwise it returns the stopInstance.
746 virtual IOobject findInstance
747 (
748 const IOobject& io,
749 const scalar startValue,
750 const word& stopInstance
751 ) const;
752
753 //- Callback for time change
754 virtual void setTime(const Time&) const;
755
756 //- Forcibly wait until all output done. Flush any cached data
757 virtual void flush() const;
758
759 //- Return cached times
761 {
762 return times_;
763 }
764};
765
766
767/*---------------------------------------------------------------------------*\
768 Class masterUncollatedFileOperationInitialise Declaration
769\*---------------------------------------------------------------------------*/
772:
774{
775public:
776
777 // Constructors
778
779 //- Construct from components
780 masterUncollatedFileOperationInitialise(int& argc, char**& argv)
781 :
782 unthreadedInitialise(argc, argv)
783 {}
784
785
786 //- Destructor
788};
789
790
791// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
792
793} // End namespace fileOperations
794} // End namespace Foam
795
796// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
797
798#ifdef NoRepository
800#endif
801
802// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
803
804#endif
805
806// ************************************************************************* //
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
label n
A HashTable of pointers to objects of type <T>, with deallocation management of the pointers.
Definition: HashPtrTable.H:68
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:170
The IOstreamOption is a simple container for options an IOstream can normally have.
streamFormat
Data format (ascii | binary)
Buffers for inter-processor communications streams (UOPstream, UIPstream).
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:80
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition: UList.H:94
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
fileState
Enumeration defining the file state.
Definition: fileMonitor.H:74
A class for handling file names.
Definition: fileName.H:76
Type
Enumerations to handle directory entry types.
Definition: fileName.H:81
@ FILE
A regular file.
Definition: fileName.H:83
An encapsulation of filesystem-related operations.
Definition: fileOperation.H:69
List< dirIndex > dirIndexList
Definition: fileOperation.H:99
virtual word processorsDir(const IOobject &io) const
Actual name of processors dir (for use in mode PROCOBJECT,.
pathType
Enumeration for the location of an IOobject.
Definition: fileOperation.H:74
masterUncollatedFileOperationInitialise(int &argc, char **&argv)
Construct from components.
virtual ~masterUncollatedFileOperationInitialise()=default
Destructor.
bool operator()(const fileName &src, const fileName &dest) const
bool operator()(const fileName &src, const fileName &dest) const
bool operator()(const fileName &src, const fileName &dest) const
readDirOp(const fileName::Type type, const bool filtergz, const bool followLink)
fileOperations that performs all file operations on the master processor. Requires the calls to be pa...
virtual void addWatches(regIOobject &, const fileNameList &) const
Helper: add watches for list of regIOobjects.
virtual double highResLastModified(const fileName &, const bool followLink=true) const
Return time of last file modification.
static word findInstancePath(const instantList &timeDirs, const instant &t)
Equivalent of Time::findInstance.
virtual autoPtr< ISstream > readStream(regIOobject &, const fileName &, const word &typeName, const bool valid=true) const
Reads header for regIOobject and returns an ISstream.
const HashPtrTable< DynamicList< instant > > & times() const noexcept
Return cached times.
virtual label addWatch(const fileName &) const
Add watching of a file. Returns handle.
static labelList subRanks(const label n)
Get the list of processors that are part of this communicator.
virtual mode_t mode(const fileName &, const bool followLink=true) const
Return the file mode.
virtual void setTime(const Time &) const
Callback for time change.
virtual fileName filePathInfo(const bool checkGlobal, const bool isFile, const IOobject &, const bool search, pathType &searchType, word &processorsDir, word &instance) const
Search (locally!) for object; return info on how it was found.
virtual autoPtr< OSstream > NewOFstream(const fileName &pathname, IOstreamOption streamOpt=IOstreamOption(), const bool valid=true) const
Generate an OSstream that writes a file.
virtual bool rmDir(const fileName &dir, const bool silent=false) const
Remove a directory and its contents.
const label myComm_
Any communicator allocated by me.
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 void flush() const
Forcibly wait until all output done. Flush any cached data.
static float maxMasterFileBufferSize
Max size of parallel communications. Switches from non-blocking.
virtual bool removeWatch(const label) const
Remove watch on a file (using handle)
virtual bool readHeader(IOobject &, const fileName &, const word &typeName) const
Read object header from supplied file.
virtual bool mvBak(const fileName &, const std::string &ext="bak") const
Rename to a corresponding backup file.
virtual fileNameList readObjects(const objectRegistry &db, const fileName &instance, const fileName &local, word &newInstance) const
Search directory for objects. Used in IOobjectList.
virtual label findWatch(const labelList &watchIndices, const fileName &) const
Find index (or -1) of file in list of handles.
virtual time_t lastModified(const fileName &, const bool followLink=true) const
Return time of last file modification.
virtual fileName dirPath(const bool checkGlobal, const IOobject &io, const bool search) const
Search for a directory. checkGlobal : also check undecomposed.
static autoPtr< ISstream > read(IOobject &io, const label comm, const bool uniform, const fileNameList &filePaths, const boolList &procValid)
Read files on comms master.
virtual bool chMod(const fileName &, const mode_t) const
Set the file mode.
Type masterOp(const fileName &fName, const FileOp &fop, const int tag, const label comm) const
virtual IOobject findInstance(const IOobject &io, const scalar startValue, const word &stopInstance) const
Find instance where IOobject is.
bool exists(const dirIndexList &, IOobject &io) const
Helper: check IO for local existence. Like filePathInfo but.
virtual off_t fileSize(const fileName &, const bool followLink=true) const
Return size of file.
virtual bool rm(const fileName &) const
Remove a file, returning true if successful otherwise false.
virtual autoPtr< ISstream > NewIFstream(const fileName &) const
Generate an ISstream that reads a file.
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 isDir(const fileName &, const bool followLink=true) const
Does the name exist as a DIRECTORY in the file system?
Type scatterList(const UList< Type > &, const int, const label comm) const
virtual fileMonitor::fileState getState(const label) const
Get current state of file (using handle)
virtual fileName filePath(const bool checkGlobal, const IOobject &io, const word &typeName, const bool search) const
Search for an object. checkGlobal : also check undecomposed case.
virtual void setUnmodified(const label) const
Set current state of file (using handle) to unmodified.
static void readAndSend(const fileName &filePath, const labelUList &procs, PstreamBuffers &pBufs)
Read file contents and send to processors.
HashPtrTable< DynamicList< instant > > times_
Cached times for a given directory.
virtual void updateStates(const bool masterOnly, const bool syncPar) const
Update state of all files.
static bool uniformFile(const fileNameList &)
Same file?
virtual bool mkDir(const fileName &, mode_t=0777) const
Make directory.
virtual fileName::Type type(const fileName &, const bool followLink=true) const
Return the file type: DIRECTORY, FILE or SYMLINK.
TypeName("masterUncollated")
Runtime type information.
virtual instantList findTimes(const fileName &, const word &) const
Get sorted list of times.
virtual bool mv(const fileName &src, const fileName &dst, const bool followLink=false) const
Rename src to dst.
virtual bool writeObject(const regIOobject &io, IOstreamOption streamOpt=IOstreamOption(), const bool valid=true) const
Writes a regIOobject (so header, contents and divider).
virtual bool ln(const fileName &src, const fileName &dst) const
Create a softlink. dst should not exist. Returns true if.
fileName localObjectPath(const IOobject &, const pathType &searchType, const word &processorsDir, const word &instancePath) const
Construct filePath.
virtual fileName getFile(const label) const
Get name of file being watched (using handle)
An instant of time. Contains the time value and name. Uses Foam::Time when formatting the name.
Definition: instant.H:56
Registry of regIOobjects.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Definition: regIOobject.H:76
A class for handling words, derived from Foam::string.
Definition: word.H:68
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
Namespace for OpenFOAM.
bool rm(const fileName &file)
Remove a file (or its gz equivalent), returning true if successful.
Definition: MSwindows.C:1012
time_t lastModified(const fileName &name, const bool followLink=true)
Return time of last file modification (normally follows symbolic links).
Definition: MSwindows.C:700
bool exists(const fileName &name, const bool checkGzip=true, const bool followLink=true)
Does the name exist (as DIRECTORY or FILE) in the file system?
Definition: MSwindows.C:633
bool mkDir(const fileName &pathName, mode_t mode=0777)
Make a directory and return an error if it could not be created.
Definition: MSwindows.C:515
mode_t mode(const fileName &name, const bool followLink=true)
Return the file mode, normally following symbolic links.
Definition: MSwindows.C:572
bool chMod(const fileName &name, const mode_t mode)
Set the file/directory mode, return true on success.
Definition: MSwindows.C:565
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition: MSwindows.C:598
bool rmDir(const fileName &directory, const bool silent=false)
Remove a directory and its contents (optionally silencing warnings)
Definition: MSwindows.C:1036
off_t fileSize(const fileName &name, const bool followLink=true)
Return size of file or -1 on failure (normally follows symbolic links).
Definition: MSwindows.C:684
double highResLastModified(const fileName &, const bool followLink=true)
Return time of last file modification.
Definition: MSwindows.C:707
fileNameList readDir(const fileName &directory, const fileName::Type type=fileName::FILE, const bool filtergz=true, const bool followLink=true)
Read a directory and return the entries as a fileName List.
Definition: MSwindows.C:715
const direction noexcept
Definition: Scalar.H:223
bool mvBak(const fileName &src, const std::string &ext="bak")
Rename to a corresponding backup file.
Definition: MSwindows.C:976
bool isFile(const fileName &name, const bool checkGzip=true, const bool followLink=true)
Does the name exist as a FILE in the file system?
Definition: MSwindows.C:666
bool cp(const fileName &src, const fileName &dst, const bool followLink=true)
Copy the source to the destination (recursively if necessary).
Definition: MSwindows.C:810
bool mv(const fileName &src, const fileName &dst, const bool followLink=false)
Rename src to dst.
Definition: MSwindows.C:947
bool ln(const fileName &src, const fileName &dst)
Create a softlink. dst should not exist. Returns true if successful.
Definition: MSwindows.C:933
bool isDir(const fileName &name, const bool followLink=true)
Does the name exist as a DIRECTORY in the file system?
Definition: MSwindows.C:651
fileName search(const word &file, const fileName &directory)
Recursively search the given directory for the file.
Definition: fileName.C:624
word format(conversionProperties.get< word >("format"))
labelList f(nPoints)
const volScalarField & cp
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73