Skip to content

Commit

Permalink
do not write into the output file if it is not a regular file
Browse files Browse the repository at this point in the history
  • Loading branch information
stereomatchingkiss committed Feb 2, 2016
1 parent 819e56d commit aa726d6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions file_location_extractor/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ int main(int argc, char *argv[])
auto result = get_directory_path(input_folder, true);
std::ofstream out(output_file);
for(auto const &path : result){
out<<absolute(path).generic_string()<<"\n";
if(is_regular_file(path)){
out<<absolute(path).generic_string()<<"\n";
}
}
}catch(std::exception const &ex){
std::cout<<ex.what()<<std::endl;
Expand All @@ -51,7 +53,7 @@ variables_map parse_command_line(int argc, char *argv[])
return vm;
}

notify(vm);
notify(vm);

return vm;
}

0 comments on commit aa726d6

Please sign in to comment.