checking if data files actually exist

This commit is contained in:
Dennis Luxen
2013-10-01 17:37:52 +02:00
parent 0f258f94a8
commit 940b740b24
2 changed files with 37 additions and 0 deletions
@@ -249,6 +249,25 @@ public:
base_path
);
if ( !boost::filesystem::exists(hsgr_path) ) {
throw(".hsgr not found");
}
if ( !boost::filesystem::exists(ram_index_path) ) {
throw(".ramIndex not found");
}
if ( !boost::filesystem::exists(file_index_path) ) {
throw(".fileIndex not found");
}
if ( !boost::filesystem::exists(node_data_path) ) {
throw(".nodes not found");
}
if ( !boost::filesystem::exists(edge_data_path) ) {
throw(".edges not found");
}
if ( !boost::filesystem::exists(name_data_path) ) {
throw(".names not found");
}
// check if data files empty
if ( 0 == boost::filesystem::file_size( node_data_path ) ) {
throw OSRMException("nodes file is empty");