Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions Steer/src/CollisionContextTool.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,15 @@ bool copy_collision_context(const std::string& external_path, int this_tf_id, in
{
namespace fs = std::filesystem;
try {
// Construct source file path
fs::path filename = fs::path(external_path) / ("collission_context_" + std::to_string(this_tf_id) + ".root");
fs::path filename;
if (fs::exists(external_path) && fs::is_regular_file(external_path)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this would exclude symlinks. Is that expected?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is good enough for now.

std::cout << "external_path is an existing file: " << external_path << "\n";
// use it directly
filename = fs::path(external_path);
} else {
// Construct source file path
filename = fs::path(external_path) / ("collission_context_" + std::to_string(this_tf_id) + ".root");
}

LOG(info) << "Checking existence of file: " << filename;

Expand Down