lib/io/writer.cc
/**
 ********************************************************************************************************************************************
 * \brief   Function to create output folder if it does not exist
 *
 *          The function uses methods available in the sys/stat.h header to create an output folder if it does not exist
 *          Without this, the code used to give segmentation fault while attempting to write solution files
 ********************************************************************************************************************************************
 */
\brief   Function to create output folder if it does not exist
The function uses methods available in the sys/stat.h header to create an output folder if it does not exist
Without this, the code used to give segmentation fault while attempting to write solution files
\ brief Function to create output folder if it does not exist The function uses methods available in the sys / stat . h header to create an output folder if it does not exist Without this the code used to give segmentation fault while attempting to write solution files
void writer::outputCheck() {
    struct stat info;
    int createStatus;
    if (mesh.rankData.rank == 0) {
        if (stat("output", &info) != 0) {
            createStatus = mkdir("output", S_IRWXU | S_IRWXG);
            if (createStatus) {
                std::cout << "Error in while attempting to create output directory. Aborting" << std::endl;
                exit(0);
            }
        }
    }
}
void writer :: outputCheck ( ) { struct stat info ; int createStatus ; if ( mesh . rankData . rank == 0 ) { if ( stat ( " " , & info ) != 0 ) { createStatus = mkdir ( " " , S_IRWXU | S_IRWXG ) ; if ( createStatus ) { std :: cout << " " << std :: endl ; exit ( 0 ) ; } } } }
\brief   Function to create output folder if it does not exist
          The function uses methods available in the sys/stat.h header to create an output folder if it does not exist
          Without this, the code used to give segmentation fault while attempting to write solution files
\ brief Function to create output folder if it does not exist The function uses methods available in the sys / stat . h header to create an output folder if it does not exist Without this the code used to give segmentation fault while attempting to write solution files
// Check if output directory exists // Raise error if the filesystem is read-only or something