Skip to content

[main] Rewrite rootmkdir in C++#21521

Open
silverweed wants to merge 3 commits intoroot-project:masterfrom
silverweed:rootmkdir_cpp
Open

[main] Rewrite rootmkdir in C++#21521
silverweed wants to merge 3 commits intoroot-project:masterfrom
silverweed:rootmkdir_cpp

Conversation

@silverweed
Copy link
Contributor

This Pull request:

Replace the python version of rootmkdir with a native one.

Changes or fixes:

I changed one small thing from the original rootmkdir: calling:

rootmkdir foo.root:dir

when foo.root does not exist would create the file and the directory in the original, whereas in this version it will error out unless you pass the -p flag. The rationale is that the top-level file should count as a "parent directory", so we should not create it implicitly unless -p is specified. Calling rootmkdir foo.root works as before (except it will error out if the file already exists).

Checklist:

  • tested changes locally
  • updated the docs (if necessary)

@silverweed silverweed requested review from dpiparo and jblomer March 6, 2026 10:28
@silverweed silverweed self-assigned this Mar 6, 2026
@github-actions
Copy link

github-actions bot commented Mar 6, 2026

Test Results

    22 files      22 suites   3d 4h 57m 27s ⏱️
 3 828 tests  3 827 ✅ 1 💤 0 ❌
76 605 runs  76 596 ✅ 9 💤 0 ❌

Results for commit 481d29a.

♻️ This comment has been updated with latest results.

Copy link
Member

@vepadulano vepadulano left a comment

Choose a reason for hiding this comment

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

Cool thanks! Some minor comments from my side.

FIXTURES_SETUP main-SimpleRootmkdir4-fixture)

ROOTTEST_ADD_TEST(SimpleRootmkdir4CheckOutput
COMMAND ${TOOLS_PREFIX}/rootls${exeext} -1 target4.root
Copy link
Member

Choose a reason for hiding this comment

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

What is the intent of the test? and/or how does it check for success?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It verifies that calling rootmkdir file.root creates an empty ROOT file (rootls returns 1 if the file does not exist and 0 otherwise)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants