-
Notifications
You must be signed in to change notification settings - Fork 191
stdlib_system
: essential path functionality
#999
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
Thanks for the PR, @wassup05. Just a minor point (not related to functionality) about examples for now: It's always useful - esp. for those learning by examples - to have an idea of the expected output. Other stdlib examples add the expected print results as a comment below the respective commands. I would recommend to do the same here. |
I will add that with the other reviews @sebastian-mutz, I don't want to trigger the ci/cd workflow just for a few comments. Also on a second thought maybe instead of the |
example/system/example_path_1.f90
Outdated
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.
I would advise to split the example per function such that each function in the specs gets it's own code snippet.
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.
p2 = joinpath('C:\Users\User1', 'Desktop') | ||
|
||
parr = [character(len=20) :: 'C:', 'Users', 'User1', 'Desktop'] | ||
p2 = joinpath(parr) |
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.
should be p3
, will change it.
A few path related functions for ease of future functionality have been added.
joinpath
: joins the given paths according to the platform'spath-separator
.operator(/)
: as was suggested in the Fortran discourse here an operator is also provided for the same functionalitysplitpath
: splits the path following the lastpath-separator
and returns thehead
andtail
.basename
: just returns thetail
ofsplitpath
dirname
: just returns thehead
ofsplitpath
The
pathsep
parameter
contains either/
or\
depending on the platform and is a compile-time constant now, so is theparameter
,ISWIN
Do let me know your thoughts.