16 return(std::string(getcwd(buf,1024)));
22 return(chdir(path.c_str()));
28 return(mkdir(fname.c_str(),S_IRGRP | S_IXGRP | S_IRWXU));
35 if(lstat(fname.c_str(),&fstat))
40 int main(
int argc,
char *argv[])
44 std::string numproc_s(argv[1]);
45 std::istringstream Istr(numproc_s);
46 std::ofstream RocinSurfFile;
47 std::ofstream RocinVolFile;
48 std::ifstream OrigSurfFile;
49 std::ifstream OrigVolFile;
50 OrigSurfFile.open(
"ifluid_in_00.000000.txt");
51 OrigVolFile.open(
"fluid_in_00.000000.txt");
52 std::string surfpanes;
53 std::string surffiles;
57 OrigSurfFile >> junk >> junk >> junk
59 std::getline(OrigSurfFile,surfpanes);
60 OrigVolFile >> junk >> junk >> junk
62 std::getline(OrigVolFile,volpanes);
65 rename(
"ifluid_in_00.000000.txt",
"ifluid_in_00.000000.txt.orig");
66 rename(
"fluid_in_00.000000.txt",
"fluid_in_00.000000.txt.orig");
67 RocinSurfFile.open(
"ifluid_in_00.000000.txt");
68 RocinVolFile.open(
"fluid_in_00.000000.txt");
71 for(
int i = 0;
i < np;
i++){
72 RocinSurfFile <<
"@Proc: " <<
i << std::endl;
73 RocinVolFile <<
"@Proc: " <<
i << std::endl;
75 std::ostringstream Ostr;
76 std::ostringstream Ostr2;
78 int nchar = Ostr2.str().length();
83 RocinSurfFile <<
"@Files: " << Ostr.str() <<
"/" << surffiles << std::endl
84 <<
"@Panes: " << surfpanes << std::endl << std::endl;
85 RocinVolFile <<
"@Files: " << Ostr.str() <<
"/" << volfiles << std::endl
86 <<
"@Panes: " << volpanes << std::endl << std::endl;
92 nchar = 5 - Ostr2.str().length();
98 std::ostringstream FNout;
99 std::ostringstream FNout2;
100 FNout <<
"fluid_" << Ostr.str() <<
".hdf";
101 FNout2 <<
"../fluid_" << Ostr.str() <<
".hdf";
102 symlink(FNout2.str().c_str(),FNout.str().c_str());
107 FNout <<
"ifluid_" << Ostr.str() <<
".hdf";
108 FNout2 <<
"../ifluid_" << Ostr.str() <<
".hdf";
110 symlink(FNout2.str().c_str(),FNout.str().c_str());
113 RocinSurfFile.close();
114 RocinVolFile.close();
bool FILEEXISTS(const std::string &fname)
int ChangeDirectory(const std::string &path)
int main(int argc, char *argv[])
int CreateDirectory(const std::string &fname)