Skip to content

Commit

Permalink
os: getenv with directories
Browse files Browse the repository at this point in the history
  • Loading branch information
vindarel committed Sep 3, 2024
1 parent e54712a commit 734da8f
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions os.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,22 @@ Also note that the
library has the method `(environment-variable "name")`, on POSIX-like
systems including Windows. It is also `fset`-able.

### Environment variables with directories (PATH)

A function allows to retrieve the list of directories from an environment variable:

```lisp
(uiop:getenv-absolute-directories "PATH")
;; => (#P"/home/vince/.local/bin/" #P"/usr/local/bin/" #P"/usr/sbin/" #P"/usr/bin/")
```

Its documentation:

> Extract a list of absolute directories from a user-configured environment variable, as per native OS. Any empty entries in the environment variable X will be returned as NILs.
Use `uiop:getenv-absolute-directory` when the env var contains one directory. See also: `uiop:getenv-pathname[s]`.


<a name="accessing-command-line"></a>

## Accessing the command line arguments
Expand Down

0 comments on commit 734da8f

Please sign in to comment.