Skip to content

Make sure that an existing path is a directory for create_directories#95

Merged
wjwwood merged 1 commit intoros2:masterfrom
christophebedard:fs-create-directories-check-if-dir
Sep 24, 2020
Merged

Make sure that an existing path is a directory for create_directories#95
wjwwood merged 1 commit intoros2:masterfrom
christophebedard:fs-create-directories-check-if-dir

Conversation

@christophebedard
Copy link
Copy Markdown
Member

@christophebedard christophebedard commented Sep 21, 2020

If the final/complete path already exists, make sure that it is a directory.

I've also added a line in the relevant test.

Fixes #94

Copy link
Copy Markdown
Member

@wjwwood wjwwood left a comment

Choose a reason for hiding this comment

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

lgtm

@wjwwood
Copy link
Copy Markdown
Member

wjwwood commented Sep 22, 2020

CI:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@christophebedard
Copy link
Copy Markdown
Member Author

I'll look into that Windows failure.

Signed-off-by: Christophe Bedard <bedard.christophe@gmail.com>
@christophebedard christophebedard force-pushed the fs-create-directories-check-if-dir branch from 1821c75 to 5675cdb Compare September 22, 2020 18:14
@christophebedard
Copy link
Copy Markdown
Member Author

christophebedard commented Sep 22, 2020

Trying something quickly, but if that doesn't work I'll have to actually try on Windows.

  • Windows Build Status

@christophebedard
Copy link
Copy Markdown
Member Author

Not exactly sure why, but it looks like that did the trick. We don't really need to check if the path is a directory at every step/recursively, since the next step will just fail if it's not a directory anyway.

I'll let you decide if you want to re-run CI on all platforms.

Copy link
Copy Markdown
Member

@wjwwood wjwwood left a comment

Choose a reason for hiding this comment

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

lgtm, new CI:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@wjwwood wjwwood merged commit a54db52 into ros2:master Sep 24, 2020
@christophebedard christophebedard deleted the fs-create-directories-check-if-dir branch September 24, 2020 17:03
wjwwood added a commit that referenced this pull request Sep 24, 2020
wjwwood added a commit that referenced this pull request Sep 25, 2020
fujitatomoya added a commit to fujitatomoya/rcpputils that referenced this pull request Sep 25, 2020
fujitatomoya added a commit to fujitatomoya/rcpputils that referenced this pull request Sep 25, 2020
…eate_directories (ros2#95)" (ros2#96)"

This reverts commit ba5d1e4.

Signed-off-by: Tomoya.Fujita <Tomoya.Fujita@sony.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rcpputils::fs::create_directories doesn't check if an existing path is a directory

2 participants