virtual int make_directory(entry_t& entry, const path_t& path) { const char_t* chars = 0; size_t length = 0; int err = 1; if ((chars = path.directory().chars(length)) && (0 < length)) { const char_t* dchars = chars; size_t dlength = length; sub_directories_t sub_directories; EV_LOG_MESSAGE_INFO("make directory \"" << chars << "\"..."); for (bool exists = false; !exists; ) { string_t directory(dchars, dlength); EV_LOG_MESSAGE_INFO("directory \"" << directory.chars() << "\" exists?..."); if (!(exists = entry.exists(directory.chars()))) { sub_directory_t sub_directory(dchars, dlength); EV_LOG_MESSAGE_INFO("...directory \"" << directory.chars() << "\" does not exist"); sub_directories.push_front(sub_directory); if ((dchars = parent_directory(dchars, dlength, path))) { continue; } } else { EV_LOG_MESSAGE_INFO("...directory \"" << directory.chars() << "\" exists"); } break; } err = make_directories(sub_directories, entry, path); } return err; }
AbstractHdf5Converter<ELEMENT_DIM, SPACE_DIM>::AbstractHdf5Converter(const FileFinder& rInputDirectory, const std::string& rFileBaseName, AbstractTetrahedralMesh<ELEMENT_DIM, SPACE_DIM>* pMesh, const std::string& rSubdirectoryName, unsigned precision) : mrH5Folder(rInputDirectory), mFileBaseName(rFileBaseName), mOpenDatasetIndex(UNSIGNED_UNSET), mpMesh(pMesh), mRelativeSubdirectory(rSubdirectoryName), mPrecision(precision) { GenerateListOfDatasets(mrH5Folder, mFileBaseName); // Create new directory in which to store everything FileFinder sub_directory(mRelativeSubdirectory, mrH5Folder); mpOutputFileHandler = new OutputFileHandler(sub_directory, false); MoveOntoNextDataset(); }