Skip to content

Commit

Permalink
Fix Create Root Directory
Browse files Browse the repository at this point in the history
If directory information is not contained in argument "-b" or directory already exist, it returns an error.
  • Loading branch information
UnaNancyOwen committed Apr 17, 2018
1 parent b6d1009 commit fe67cb7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion rs_bag2image/realsense.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<rs2::stream_profile> stream_profiles = pipeline_profile.get_streams();
Expand Down
2 changes: 1 addition & 1 deletion rs_bag2image/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 )

Expand Down

0 comments on commit fe67cb7

Please sign in to comment.