From fe67cb792807cd1a7ceea08aa341bdf2641ecac8 Mon Sep 17 00:00:00 2001 From: Tsukasa Sugiura Date: Tue, 17 Apr 2018 15:48:30 +0900 Subject: [PATCH] Fix Create Root Directory If directory information is not contained in argument "-b" or directory already exist, it returns an error. --- rs_bag2image/realsense.cpp | 4 +++- rs_bag2image/version.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/rs_bag2image/realsense.cpp b/rs_bag2image/realsense.cpp index 629db10..9b9ebef 100644 --- a/rs_bag2image/realsense.cpp +++ b/rs_bag2image/realsense.cpp @@ -166,7 +166,9 @@ inline void RealSense::initializeSave() { // Create Root Directory (Bag File Name) directory = bag_file.parent_path().generic_string() + "/" + bag_file.stem().string(); - filesystem::create_directories( directory ); + if( !filesystem::create_directories( directory ) ){ + throw std::runtime_error( "failed can't create root directory" ); + } // Create Sub Directory for Each Streams (Stream Name) const std::vector stream_profiles = pipeline_profile.get_streams(); diff --git a/rs_bag2image/version.h b/rs_bag2image/version.h index 448ac04..c2a116a 100644 --- a/rs_bag2image/version.h +++ b/rs_bag2image/version.h @@ -6,7 +6,7 @@ #define VERSION_MAJOR 0 #define VERSION_MINOR 1 -#define VERSION_REVISION 1 +#define VERSION_REVISION 2 #define VERSION TO_STRING( VERSION_MAJOR ) "." TO_STRING( VERSION_MINOR ) "." TO_STRING( VERSION_REVISION )