OSspecific: isDir(), isFile() instead of dir(), file()

This commit is contained in:
Mark Olesen
2009-02-02 16:50:18 +01:00
parent 91e12bc50f
commit e5c5829244
30 changed files with 85 additions and 85 deletions

View File

@ -105,7 +105,7 @@ int main(int argc, char *argv[])
// determine the existing processor count directly
label nProcs = 0;
while (dir(runTime.path()/(word("processor") + name(nProcs))))
while (isDir(runTime.path()/(word("processor") + name(nProcs))))
{
++nProcs;
}
@ -480,7 +480,7 @@ int main(int argc, char *argv[])
// Any uniform data to copy/link?
fileName uniformDir("uniform");
if (dir(runTime.timePath()/uniformDir))
if (isDir(runTime.timePath()/uniformDir))
{
Info<< "Detected additional non-decomposed files in "
<< runTime.timePath()/uniformDir

View File

@ -63,7 +63,7 @@ int main(int argc, char *argv[])
// determine the processor count directly
label nProcs = 0;
while (dir(args.path()/(word("processor") + name(nProcs))))
while (isDir(args.path()/(word("processor") + name(nProcs))))
{
++nProcs;
}
@ -383,7 +383,7 @@ int main(int argc, char *argv[])
// the master processor.
fileName uniformDir0 = databases[0].timePath()/"uniform";
if (dir(uniformDir0))
if (isDir(uniformDir0))
{
cp(uniformDir0, runTime.timePath());
}

View File

@ -503,7 +503,7 @@ int main(int argc, char *argv[])
# include "setRootCase.H"
// Create processor directory if non-existing
if (!Pstream::master() && !dir(args.path()))
if (!Pstream::master() && !isDir(args.path()))
{
Pout<< "Creating case directory " << args.path() << endl;
mkDir(args.path());
@ -525,7 +525,7 @@ int main(int argc, char *argv[])
const fileName meshDir = runTime.path()/masterInstDir/polyMesh::meshSubDir;
boolList haveMesh(Pstream::nProcs(), false);
haveMesh[Pstream::myProcNo()] = dir(meshDir);
haveMesh[Pstream::myProcNo()] = isDir(meshDir);
Pstream::gatherList(haveMesh);
Pstream::scatterList(haveMesh);
Info<< "Per processor mesh availability : " << haveMesh << endl;

View File

@ -131,7 +131,7 @@ int main(int argc, char *argv[])
if (Pstream::master())
{
if (dir(postProcPath))
if (isDir(postProcPath))
{
rmDir(postProcPath);
}

View File

@ -136,7 +136,7 @@ int main(int argc, char *argv[])
// Ensight and Ensight/data directories must exist
// do not remove old data - we might wish to convert new results
// or a particular time interval
if (dir(ensightDir))
if (isDir(ensightDir))
{
Info<<"Warning: reusing existing directory" << nl
<< " " << ensightDir << endl;
@ -324,7 +324,7 @@ int main(int argc, char *argv[])
{
const word& cloudName = cloudIter.key();
if (!dir(runTime.timePath()/regionPrefix/"lagrangian"/cloudName))
if (!isDir(runTime.timePath()/regionPrefix/"lagrangian"/cloudName))
{
continue;
}

View File

@ -260,7 +260,7 @@ int main(int argc, char *argv[])
// make a directory called FieldView in the case
fileName fvPath(runTime.path()/"Fieldview");
if (dir(fvPath))
if (isDir(fvPath))
{
rmDir(fvPath);
}
@ -346,7 +346,7 @@ int main(int argc, char *argv[])
// Output the magic number.
writeInt(fvFile, FV_MAGIC);
// Output file header and version number.
writeStr80(fvFile, "FIELDVIEW");
@ -417,7 +417,7 @@ int main(int argc, char *argv[])
{
if (volFieldPtrs[fieldI] == NULL)
{
Info<< " dummy field for "
Info<< " dummy field for "
<< volFieldNames[fieldI].c_str() << endl;
}

View File

@ -333,7 +333,7 @@ int main(int argc, char *argv[])
regionPrefix = regionName;
}
if (dir(fvPath))
if (isDir(fvPath))
{
if
(

View File

@ -228,7 +228,7 @@ Foam::vtkPV3Foam::vtkPV3Foam
// avoid argList and get rootPath/caseName directly from the file
fileName fullCasePath(fileName(FileName).path());
if (!dir(fullCasePath))
if (!isDir(fullCasePath))
{
return;
}
@ -518,7 +518,7 @@ double* Foam::vtkPV3Foam::findTimes(int& nTimeSteps)
if
(
file(runTime.path()/timeName/meshDir_/"points")
isFile(runTime.path()/timeName/meshDir_/"points")
&& IOobject("points", timeName, meshDir_, runTime).headerOk()
)
{

View File

@ -194,7 +194,7 @@ void Foam::vtkFoam::updateSelectedRegions()
// Read the selected patches and add to the region list
for (int i=0; i<nRegions; i++)
{
selectedRegions_[i] =
selectedRegions_[i] =
reader_->GetRegionSelection()->GetArraySetting(i);
}
}
@ -282,7 +282,7 @@ void Foam::vtkFoam::convertMesh()
else
{
// A patch already existent in the list and which
// continues to exist found
// continues to exist found
regioni++;
}
}
@ -391,7 +391,7 @@ Foam::vtkFoam::vtkFoam(const char* const FileName, vtkFoamReader* reader)
{
fileName fullCasePath(fileName(FileName).path());
if (!dir(fullCasePath))
if (!isDir(fullCasePath))
{
return;
}
@ -572,7 +572,7 @@ void Foam::vtkFoam::Update()
{
Info<< "Reading Mesh" << endl;
}
meshPtr_ =
meshPtr_ =
new fvMesh
(
IOobject

View File

@ -47,7 +47,7 @@ int USERD_set_filenames
}
caseDir = tmp;
if (!dir(rootDir/caseDir))
if (!isDir(rootDir/caseDir))
{
Info<< rootDir/caseDir << " is not a valid directory."
<< endl;
@ -144,7 +144,7 @@ int USERD_set_filenames
}
isTensor[n] = isitTensor;
}
bool lagrangianNamesFound = false;
label n = 0;
while (!lagrangianNamesFound && n < Num_time_steps)
@ -176,7 +176,7 @@ int USERD_set_filenames
Info << "[Found lagrangian]" << endl;
delete sprayPtr;
sprayPtr = new Cloud<passiveParticle>(*meshPtr);
IOobjectList objects(*meshPtr, runTime.timeName(), "lagrangian");

View File

@ -132,8 +132,8 @@ static void errorMsg(const string& msg)
// Simple check if directory is valid case directory.
static bool validCase(const fileName& rootAndCase)
{
//if (dir(rootAndCase/"system") && dir(rootAndCase/"constant"))
if (dir(rootAndCase/"constant"))
//if (isDir(rootAndCase/"system") && isDir(rootAndCase/"constant"))
if (isDir(rootAndCase/"constant"))
{
return true;
}
@ -528,7 +528,7 @@ void user_query_file_function
return;
}
}
fileName rootDir(rootAndCase.path());

View File

@ -63,7 +63,7 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
volVectorField U(Uheader, mesh);
if (file(runTime.constantPath()/"thermophysicalProperties"))
if (isFile(runTime.constantPath()/"thermophysicalProperties"))
{
// thermophysical Mach
autoPtr<basicThermo> thermo