-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added directory and file utils to replace tinydir #218
Conversation
Signed-off-by: ahcorde <ahcorde@gmail.com>
Just a note that this shouldn't have a major documentation impact as |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments on the documentation.
I can't tell if this is completely covered by the current filesystem tests. Does this need additional test coverage?
The new API certainly needs test coverage. |
Signed-off-by: ahcorde <ahcorde@gmail.com>
Signed-off-by: ahcorde <ahcorde@gmail.com>
Added test coverage 98a64ec |
According with the comment of @mikaelarguedas in rcl ros2/rcl#605 (comment) this code probably makes no sense. @dirk-thomas should we close both PRs? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, though I just skimmed it. Some comments/nitpicks.
/// is the file a directory ? | ||
int is_dir; | ||
// information about the file | ||
#ifndef _WIN32 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: these preprocessor directives are usually not indented.
int error = closedir(dir->dir); | ||
// The closedir() function returns 0 on success | ||
if (error) { | ||
#else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: this indent is weird too
#else | ||
// If the function succeeds, the return value is nonzero. | ||
if (!FindClose(dir->dir)) { | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GitHub is failing to render this, maybe that's the source of your uncrustify issue too?
if (lstat( | ||
#else | ||
if (_tstat( | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, this stanza is likely the issue... I'd recommend using a #define
for this function name if that's all that really is different.
If the API is not used anymore, yes, I think it should just be removed. |
This PR is part of the effort to reduce the number of dependencies in ROS 2. Tinydir is only used in RCL in one place to find a folder that match with a string.
I have created a new file
directory_and_file_reader.[hc]
maybe I can include this code infilesystem.[hc]
.Signed-off-by: ahcorde ahcorde@gmail.com