Skip to content

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

wassup05
Copy link
Contributor

@wassup05 wassup05 commented Aug 11, 2025

User facing functions added are:

  • is_abs(path): returns a logical indicating if the path is absolute.
  • abs_path(path [, err]): returns the absolutized version of the path.

is_abs does pure string manipulation checking if

  • on POSIX systems, path starts with /
  • on Windows systems it is either an UNC path or starts with a drive letter like C:\

abs_path performs a syscall to get the current working directory and then joins it to the path, returning the joined path

Prior Art

os.path.abspath (Python)
os.path.isabs (Python)

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.

1 participant