checking if data files actually exist
This commit is contained in:
parent
7824e1446a
commit
5b03366909
@ -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");
|
||||
|
@ -86,6 +86,24 @@ int main(int argc, char * argv[]) {
|
||||
base_path
|
||||
);
|
||||
|
||||
//check if data files actually exist
|
||||
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(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");
|
||||
|
Loading…
Reference in New Issue
Block a user