setSystemRunTimeDictionaryIO.H
Go to the documentation of this file.
1 fileName dictPath = "";
2 if (args.optionFound("dict"))
3 {
4  dictPath = args["dict"];
5  if (isDir(dictPath))
6  {
7  dictPath = dictPath / dictName;
8  }
9 }
10 
11 IOobject dictIO
12 (
13  dictName,
14  runTime.system(),
15  runTime,
16  IOobject::MUST_READ_IF_MODIFIED,
17  IOobject::NO_WRITE
18 );
19 
20 if (dictPath.size())
21 {
22  dictIO = IOobject
23  (
24  dictPath,
25  runTime,
26  IOobject::MUST_READ_IF_MODIFIED,
27  IOobject::NO_WRITE
28  );
29 }
IOobject dictIO(dictName, runTime.system(), runTime, IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE)
bool isDir(const fileName &)
Does the name exist as a DIRECTORY in the file system?
Definition: POSIX.C:486
bool optionFound(const word &opt) const
Return true if the named option is found.
Definition: argListI.H:108
fileName dictPath
word dictName("noiseDict")
Foam::argList args(argc, argv)