File tree 1 file changed +23
-16
lines changed
1 file changed +23
-16
lines changed Original file line number Diff line number Diff line change @@ -409,24 +409,31 @@ class H5CytoFrame:public CytoFrame{
409
409
void convertToPb (pb::CytoFrame & fr_pb, const string & h5_filename, H5Option h5_opt) const
410
410
{
411
411
fr_pb.set_is_h5 (true );
412
- if (! fs::equivalent ( fs::path (filename_). parent_path (), fs::path (h5_filename). parent_path ()) )
412
+ if (h5_opt != H5Option::skip )
413
413
{
414
- switch (h5_opt)
414
+ auto dest = fs::path (h5_filename).parent_path ();
415
+ if (!fs::exists (dest))
416
+ throw (logic_error (dest.string () + " doesn't exist!" ));
417
+
418
+ if (!fs::equivalent (fs::path (filename_).parent_path (), dest))
415
419
{
416
- case H5Option::copy:
417
- fs::copy (filename_, h5_filename);
418
- break ;
419
- case H5Option::move:
420
- fs::rename (filename_, h5_filename);
421
- break ;
422
- case H5Option::link :
423
- fs::create_hard_link (filename_, h5_filename);
424
- break ;
425
- case H5Option::symlink :
426
- fs::create_symlink (filename_, h5_filename);
427
- break ;
428
- case H5Option::skip:
429
- break ;
420
+ switch (h5_opt)
421
+ {
422
+ case H5Option::copy:
423
+ fs::copy (filename_, h5_filename);
424
+ break ;
425
+ case H5Option::move:
426
+ fs::rename (filename_, h5_filename);
427
+ break ;
428
+ case H5Option::link :
429
+ fs::create_hard_link (filename_, h5_filename);
430
+ break ;
431
+ case H5Option::symlink :
432
+ fs::create_symlink (filename_, h5_filename);
433
+ break ;
434
+ default :
435
+ throw (logic_error (" invalid h5_opt!" ));
436
+ }
430
437
}
431
438
}
432
439
}
You can’t perform that action at this time.
0 commit comments