feat: path functions is_abs and abs_path#1027
Conversation
There was a problem hiding this comment.
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. |
sebastian-mutz
left a comment
There was a problem hiding this comment.
LGTM with the recent change, @wassup05. Many thanks.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1027 +/- ##
==========================================
- Coverage 68.05% 67.94% -0.11%
==========================================
Files 402 403 +1
Lines 12839 12942 +103
Branches 1383 1406 +23
==========================================
+ Hits 8738 8794 +56
- Misses 4101 4148 +47 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
User facing functions added are:
is_abs(path): returns alogicalindicating if the path is absolute.abs_path(path [, err]): returns the absolutized version of the path.is_absdoes pure string manipulation checking ifpathstarts with/UNCpath or starts with a drive letter likeC:\abs_pathperforms a syscall to get the current working directory and thenjoinsit to thepath, returning thejoinedpathPrior Art
os.path.abspath(Python)os.path.isabs(Python)