Skip to content
Snippets Groups Projects
Commit cdaca4d5 authored by Stephan Schulz's avatar Stephan Schulz
Browse files

check for correct permissions of VTK output directories

parent c74ce5e8
No related branches found
No related tags found
1 merge request!18Fortran error tests
Pipeline #58619 passed
...@@ -228,6 +228,7 @@ int main(int argc, char** argv) ...@@ -228,6 +228,7 @@ int main(int argc, char** argv)
jall->printVTKoutlines(CurrentStep); jall->printVTKoutlines(CurrentStep);
} catch (ALL::FilesystemErrorException &e) { } catch (ALL::FilesystemErrorException &e) {
std::cout << e.what() << std::endl; std::cout << e.what() << std::endl;
std::exit(2);
// Maybe also treat this error in some way, e.g. whether the simulation // Maybe also treat this error in some way, e.g. whether the simulation
// should abort if no output could be written or not. // should abort if no output could be written or not.
} }
......
...@@ -44,6 +44,7 @@ install(TARGETS read_binary_output ...@@ -44,6 +44,7 @@ install(TARGETS read_binary_output
add_executable(ALL_Staggered ALL_Staggered.cpp) add_executable(ALL_Staggered ALL_Staggered.cpp)
if(CM_ALL_VTK_OUTPUT) if(CM_ALL_VTK_OUTPUT)
target_compile_definitions(ALL_Staggered PRIVATE ALL_VTK_OUTPUT_EXAMPLE)
target_include_directories(ALL_Staggered PUBLIC ${VTK_INCLUDE_DIRS}) target_include_directories(ALL_Staggered PUBLIC ${VTK_INCLUDE_DIRS})
target_link_libraries(ALL_Staggered PUBLIC ${VTK_LIBRARY_DIRS}) target_link_libraries(ALL_Staggered PUBLIC ${VTK_LIBRARY_DIRS})
endif(CM_ALL_VTK_OUTPUT) endif(CM_ALL_VTK_OUTPUT)
...@@ -111,6 +112,7 @@ if(CM_ALL_FORTRAN) ...@@ -111,6 +112,7 @@ if(CM_ALL_FORTRAN)
add_executable(ALL_Staggered_f ALL_Staggered_f.F90) add_executable(ALL_Staggered_f ALL_Staggered_f.F90)
if(CM_ALL_VTK_OUTPUT) if(CM_ALL_VTK_OUTPUT)
target_compile_definitions(ALL_Staggered_f PRIVATE ALL_VTK_OUTPUT_EXAMPLE)
target_include_directories(ALL_Staggered_f PUBLIC ${VTK_INCLUDE_DIRS}) target_include_directories(ALL_Staggered_f PUBLIC ${VTK_INCLUDE_DIRS})
target_link_libraries(ALL_Staggered_f PUBLIC ${VTK_LIBRARY_DIRS}) target_link_libraries(ALL_Staggered_f PUBLIC ${VTK_LIBRARY_DIRS})
endif(CM_ALL_VTK_OUTPUT) endif(CM_ALL_VTK_OUTPUT)
......
...@@ -827,6 +827,15 @@ private: ...@@ -827,6 +827,15 @@ private:
__FILE__, __func__, __LINE__, __FILE__, __func__, __LINE__,
"Could not create output directory."); "Could not create output directory.");
} }
// check permission in case directory already existed, but had wrong
// permissions
struct stat attr;
stat(filename, &attr);
if( (attr.st_mode & S_IRWXU) != S_IRWXU) {
throw FilesystemErrorException(
__FILE__, __func__, __LINE__,
"Possibly already existing directory does not have correct permissions (rwx) for user");
}
} }
......
...@@ -2,4 +2,7 @@ add_subdirectory(unit) ...@@ -2,4 +2,7 @@ add_subdirectory(unit)
if(CM_ALL_TESTS_INTEGRATION) if(CM_ALL_TESTS_INTEGRATION)
add_subdirectory(feature) add_subdirectory(feature)
endif() endif()
if(CM_ALL_FORTRAN)
add_subdirectory(fortran_error)
endif()
# vim: sw=4 ts=4 et # vim: sw=4 ts=4 et
# vim: et sw=4 ts=4
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment