33 #ifndef fileOperations_masterUncollatedFileOperation_H 34 #define fileOperations_masterUncollatedFileOperation_H 47 namespace fileOperations
100 const bool followLink_;
102 modeOp(
const bool followLink)
104 followLink_(followLink)
115 const bool followLink_;
117 typeOp(
const bool followLink)
119 followLink_(followLink)
130 const bool checkGzip_;
131 const bool followLink_;
133 existsOp(
const bool checkGzip,
const bool followLink)
135 checkGzip_(checkGzip),
136 followLink_(followLink)
147 const bool followLink_;
151 followLink_(followLink)
163 const bool checkGzip_;
164 const bool followLink_;
166 isFileOp(
const bool checkGzip,
const bool followLink)
168 checkGzip_(checkGzip),
169 followLink_(followLink)
180 const bool followLink_;
184 followLink_(followLink)
196 const bool followLink_;
200 followLink_(followLink)
212 const bool followLink_;
216 followLink_(followLink)
230 mvBakOp(
const std::string& ext)
261 const bool followLink_;
263 cpOp(
const bool followLink)
265 followLink_(followLink)
271 return Foam::cp(src, dest, followLink_);
286 const bool followLink_;
288 mvOp(
const bool followLink)
290 followLink_(followLink)
296 return Foam::mv(src, dest, followLink_);
324 const bool filtergz_;
325 const bool followLink_;
331 const bool followLink
336 followLink_(followLink)
351 template<
class Type,
class fileOp>
354 template<
class Type,
class fileOp>
374 const bool checkGlobal,
437 const bool followLink =
true 444 const bool followLink =
true 452 const bool checkGzip=
true,
453 const bool followLink =
true 460 const bool followLink =
true 468 const bool checkGzip=
true,
469 const bool followLink =
true 476 const bool followLink =
true 483 const bool followLink =
true 490 const bool followLink =
true 498 const bool filtergz=
true,
499 const bool followLink =
true 507 const bool followLink =
true 519 const bool followLink =
false 528 const std::string& ext =
"bak" 551 const bool checkGlobal,
560 const bool checkGlobal,
587 const word& typeName,
588 const bool valid =
true 595 const bool masterOnly,
608 const bool valid =
true 621 const bool valid =
true 649 const bool masterOnly,
pathType
Enumeration for the location of an IOobject.
virtual mode_t mode(const fileName &, const bool followLink=true) const
Return the file mode.
static word findInstancePath(const instantList &timeDirs, const instant &t)
Equivalent of Time::findInstance.
time_t lastModified(const fileName &, const bool followLink=true)
Return time of last file modification.
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 fileMonitor::fileState getState(const label) const
Get current state of file (using handle)
virtual bool cp(const fileName &src, const fileName &dst, const bool followLink=true) const
Copy, recursively if necessary, the source to the destination.
virtual bool chMod(const fileName &, const mode_t) const
Set the file mode.
virtual bool mv(const fileName &src, const fileName &dst, const bool followLink=false) const
Rename src to dst.
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.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
bool mv(const fileName &src, const fileName &dst, const bool followLink=false)
Rename src to dst.
A class for handling file names.
masterUncollatedFileOperation(const bool verbose)
Construct null.
virtual time_t lastModified(const fileName &, const bool followLink=true) const
Return time of last file modification.
virtual label addWatch(const fileName &) const
Add watching of a file. Returns handle.
HashPtrTable< instantList > times_
Cached times for a given directory.
bool operator()(const fileName &fName) const
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.
virtual autoPtr< ISstream > NewIFstream(const fileName &) const
Generate an ISstream that reads a file.
off_t fileSize(const fileName &, const bool followLink=true)
Return size of file.
fileState
Enumeration defining the file state.
virtual double highResLastModified(const fileName &, const bool followLink=true) const
Return time of last file modification.
static const fileName null
An empty fileName.
virtual autoPtr< ISstream > readStream(regIOobject &, const fileName &, const word &typeName, const bool valid=true) const
Reads header for regIOobject and returns an ISstream.
TypeName("masterUncollated")
Runtime type information.
virtual bool readHeader(IOobject &, const fileName &, const word &typeName) const
Read object header from supplied file.
virtual bool isDir(const fileName &, const bool followLink=true) const
Does the name exist as a DIRECTORY in the file system?
virtual bool rmDir(const fileName &) const
Remove a dirctory and its contents.
bool cp(const fileName &src, const fileName &dst, const bool followLink=true)
Copy, recursively if necessary, the source to the destination.
word format(conversionProperties.lookup("format"))
virtual bool ln(const fileName &src, const fileName &dst) const
Create a softlink. dst should not exist. Returns true if.
A HashTable specialization for hashing pointers.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
bool mvBak(const fileName &, const std::string &ext="bak")
Rename to a corresponding backup file.
static fileName objectPath(const IOobject &, const pathType &, const word &)
Construct filePath.
mkDirOp(const mode_t mode)
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
virtual bool writeObject(const regIOobject &, IOstream::streamFormat format=IOstream::ASCII, IOstream::versionNumber version=IOstream::currentVersion, IOstream::compressionType compression=IOstream::UNCOMPRESSED, const bool valid=true) const
Writes a regIOobject (so header, contents and divider).
static label splitProcessorPath(const fileName &, fileName &path, fileName &local)
Split fileName into part before processor and part after.
fileName filePathInfo(const bool checkGlobal, const bool isFile, const IOobject &, pathType &, word &) const
Search for object; return info on how it was found.
static instantList timeDirs
static float maxMasterFileBufferSize
Max size of parallel communications. Switches from non-blocking.
bool isDir(const fileName &, const bool followLink=true)
Does the name exist as a DIRECTORY in the file system?
A class for handling words, derived from string.
mode_t mode(const fileName &, const bool followLink=true)
Return the file mode.
virtual void addWatches(regIOobject &, const fileNameList &) const
Helper: add watches for list of regIOobjects.
static void readAndSend(const fileName &filePath, const IOstream::compressionType cmp, const labelUList &procs, PstreamBuffers &pBufs)
Read file contents and send to processors.
streamFormat
Enumeration for the format of data in the stream.
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?
virtual bool removeWatch(const label) const
Remove watch on a file (using handle)
Type masterOp(const fileName &, const fileOp &fop) const
virtual void updateStates(const bool masterOnly, const bool syncPar) const
Update state of all files.
bool ln(const fileName &src, const fileName &dst)
Create a softlink. dst should not exist. Returns true if successful.
compressionType
Enumeration for the format of data in the stream.
bool rmDir(const fileName &)
Remove a dirctory and its contents.
bool isFile(const fileName &, const bool checkGzip=true, const bool followLink=true)
Does the name exist as a FILE in the file system?
virtual fileName filePath(const bool checkGlobal, const IOobject &, const word &typeName) const
Search for an object. checkGlobal : also check undecomposed case.
virtual bool mvBak(const fileName &, const std::string &ext="bak") const
Rename to a corresponding backup file.
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
Buffers for inter-processor communications streams (UOPstream, UIPstream).
bool mkDir(const fileName &, mode_t=0777)
Make a directory and return an error if it could not be created.
fileName::Type type(const fileName &, const bool followLink=true)
Return the file type: DIRECTORY or FILE.
virtual ~masterUncollatedFileOperation()
Destructor.
virtual bool mkDir(const fileName &, mode_t=0777) const
Make directory.
virtual instantList findTimes(const fileName &, const word &) const
Get sorted list of times.
An instant of time. Contains the time value and name.
virtual bool rm(const fileName &) const
Remove a file, returning true if successful otherwise false.
static bool uniformFile(const fileNameList &)
Same file?
static const versionNumber currentVersion
Current version number.
static fileName processorsPath(const IOobject &, const word &)
Like io.path with provided instance and any 'processorXXX'.
virtual bool read(regIOobject &, const bool masterOnly, const IOstream::streamFormat format, const word &typeName) const
Top-level read.
virtual void setUnmodified(const label) const
Set current state of file (using handle) to unmodified.
bool chMod(const fileName &, const mode_t)
Set the file mode.
const HashPtrTable< instantList > & times() const
Return cached times.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
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.
virtual fileName::Type type(const fileName &, const bool followLink=true) const
Return the file type: DIRECTORY, FILE or LINK.
virtual fileName getFile(const label) const
Get name of file being watched (using handle)
virtual off_t fileSize(const fileName &, const bool followLink=true) const
Return size of file.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
virtual label findWatch(const labelList &watchIndices, const fileName &) const
Find index (or -1) of file in list of handles.
virtual fileNameList readObjects(const objectRegistry &db, const fileName &instance, const fileName &local, word &newInstance) const
Search directory for objects. Used in IOobjectList.
bool rm(const fileName &)
Remove a file, returning true if successful otherwise false.
Registry of regIOobjects.
virtual void setTime(const Time &) const
Callback for time change.
fileOperations that performs all file operations on the master processor. Requires the calls to be pa...
virtual fileName dirPath(const bool checkGlobal, const IOobject &) const
Search for a directory. checkGlobal : also check undecomposed.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
static fileName processorsCasePath(const IOobject &)
root+casename with any 'processorXXX' replaced by 'processsors'
Type scatterList(const UList< Type > &) const
bool exists(const fileName &, const bool checkGzip=true, const bool followLink=true)
Does the name exist (as DIRECTORY or FILE) in the file system?
Type
Enumerations to handle file types and modes.
double highResLastModified(const fileName &, const bool followLink=true)
Return time of last file modification.