stdlib icon indicating copy to clipboard operation
stdlib copied to clipboard

feat: path functions `is_abs` and `abs_path`

Open wassup05 opened this issue 4 months ago • 1 comments

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)

wassup05 avatar Aug 11 '25 16:08 wassup05

I had that in mind too @sebastian-mutz, and I have changed it now.

wassup05 avatar Aug 13 '25 16:08 wassup05