Skip to content

Commit

Permalink
fix(userspace/falco): fix create_dir behaviour
Browse files Browse the repository at this point in the history
Signed-off-by: Roberto Scolaro <[email protected]>
  • Loading branch information
therealbobo authored and poiana committed Nov 13, 2023
1 parent fde8da0 commit 92b42c9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion userspace/falco/app/actions/create_requested_paths.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,15 @@ falco::app::run_result falco::app::actions::create_requested_paths(falco::app::s
return run_result::ok();
}

// This function operates like `mkdir -p` excluding the last part of
// the path which we assume to be the filename.
static int create_dir(const std::string &path)
{

std::filesystem::path dirPath(path);

try {
std::filesystem::create_directories(dirPath);
std::filesystem::create_directories(dirPath.parent_path());
} catch (const std::exception& ex) {
return -1;
}
Expand Down

0 comments on commit 92b42c9

Please sign in to comment.