-
Notifications
You must be signed in to change notification settings - Fork 192
feat: path functions is_abs
and abs_path
#1027
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
base: master
Are you sure you want to change the base?
Conversation
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.
Thanks, @wassup05!
I'm wondering if is_abs_path
may be better to use. While "path" is the first thing many will think of from context, it is entirely implied. Even in the use statement stdlib_system, only: is_abs
, it's not visible (c.f. Python's os.path.isabs
).
I had that in mind too @sebastian-mutz, and I have changed it now. |
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 with the recent change, @wassup05. Many thanks.
User facing functions added are:
is_abs(path)
: returns alogical
indicating if the path is absolute.abs_path(path [, err])
: returns the absolutized version of the path.is_abs
does pure string manipulation checking ifpath
starts with/
UNC
path or starts with a drive letter likeC:\
abs_path
performs a syscall to get the current working directory and thenjoins
it to thepath
, returning thejoined
pathPrior Art
os.path.abspath
(Python)os.path.isabs
(Python)