The path-string Reference Manual

This is the path-string Reference Manual, version 0.1.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Sep 15 06:19:07 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

The main system appears first, followed by any subsystem dependency.


2.1 path-string

A path utility library

Author

Cayman Nava

License

MIT

Long Description

# path-string
[![Build Status](https://travis-ci.org/wemeetagain/path-string.svg?branch=master)](https://travis-ci.org/wemeetagain/path-string)
[![Coverage Status](https://coveralls.io/repos/wemeetagain/path-string/badge.svg?branch=master&service=github)](https://coveralls.io/github/wemeetagain/path-string?branch=master)

Path string utility library based on nodejs’ [path](https://nodejs.org/api/path.html).

> This module contains utilities for handling and transforming file paths. Almost all these methods perform only string transformations. The file system is not consulted to check whether paths are valid.

The windows-compatible version has yet to be implemented.

## Examples

“‘lisp
(path-string:normalize "/foo/bar//baz/asdf/quux/..")

;; => "/foo/bar/baz/asdf"

(path-string:join "/foo" "bar" "baz/asdf" "quux" "..")

;; => "/foo/bar/baz/asdf"

(path-string:resolve "foo/bar" "/tmp/file/" ".." "a/../subfile")

;; => "/tmp/subfile"

(path-string:absolute-p "/tmp/file")

;; => #P"/tmp/file"

(path-string:relative "/data/orandea/test/aaa" "/data/orandea/impl/bbb")

;; => "../../impl/bbb"

(path-string:dirname "/foo/bar/baz/asdf/quux")

;; => "/foo/bar/baz/asdf"

(path-string:basename "/foo/bar/baz/asdf/quux.html")

;; => "quux.html"

(path-string:extname "index.html")

;; => ".html"

(path-string:parse "/home/user/dir/file.txt")

;; => "/"
;; "/home/user/dir"
;; "file.txt"
;; ".txt"
;; "file"
“‘

## License

MIT

Version

0.1.0

Dependencies
  • cl-ppcre (system).
  • split-sequence (system).
  • uiop (system).
Source

path-string.asd.

Child Component

src (module).


3 Modules

Modules are listed depth-first from the system components tree.


3.1 path-string/src

Source

path-string.asd.

Parent Component

path-string (system).

Child Components

4 Files

Files are sorted by type and then listed depth-first from the systems components trees.


4.1 Lisp


4.1.1 path-string/path-string.asd

Source

path-string.asd.

Parent Component

path-string (system).

ASDF Systems

path-string.


4.1.2 path-string/src/util.lisp

Source

path-string.asd.

Parent Component

src (module).

Packages

path-string.util.

Public Interface

4.1.3 path-string/src/posix.lisp

Dependency

util.lisp (file).

Source

path-string.asd.

Parent Component

src (module).

Packages

path-string.posix.

Public Interface

4.1.4 path-string/src/path-string.lisp

Dependency

posix.lisp (file).

Source

path-string.asd.

Parent Component

src (module).

Packages

path-string.


4.1.5 path-string/src/documentation.lisp

Dependency

path-string.lisp (file).

Source

path-string.asd.

Parent Component

src (module).


5 Packages

Packages are listed by definition order.


5.1 path-string

Source

path-string.lisp.

Use List

5.2 path-string.posix

Source

posix.lisp.

Use List

common-lisp.

Used By List

path-string.

Public Interface

5.3 path-string.util

Source

util.lisp.

Use List

common-lisp.

Public Interface

6 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


6.1 Public Interface


6.1.1 Special variables

Special Variable: *delimiter*

The platform-specific path delimiter, ’;’ or ’;’.

Package

path-string.posix.

Source

posix.lisp.

Special Variable: *posix-split-path-re*
Package

path-string.util.

Source

util.lisp.

Special Variable: *sep*

The platform-specific file separator, ’\’ or ’/’.

Package

path-string.posix.

Source

posix.lisp.


6.1.2 Ordinary functions

Function: absolute-p (path)

Determines whether the path is an absolute path. An absolute path will always resolve to the same location, regardless of the working directory.

Package

path-string.posix.

Source

posix.lisp.

Function: basename (path &optional ext)

Return the last portion of a path. Similar to the Unix baseline command.

Package

path-string.posix.

Source

posix.lisp.

Function: dirname (path)

Return the directory name of a path. Similar to the Unix dirname command.

Package

path-string.posix.

Source

posix.lisp.

Function: extname (path)

Return the extension of the path, from the last ’.’ to the end of the
string in the last portion of the path. If there is no ’.’ in the last portion of the path or the first character of it is ’.’, then then return an empty string.

Package

path-string.posix.

Source

posix.lisp.

Function: join (&rest paths)

Join all arguments together and normalize the resulting path.

Package

path-string.posix.

Source

posix.lisp.

Function: normalize (path)

Normalize a path string, taking care of ’..’ and ’.’ parts.

Package

path-string.posix.

Source

posix.lisp.

Function: normalize-list (parts &optional allow-above-root-p)
Package

path-string.util.

Source

util.lisp.

Function: parse (path)

Returns a list of path pieces (ROOT DIR BASE EXT NAME) from a path string.

Package

path-string.posix.

Source

posix.lisp.

Function: posix-format-path (path absolute-p)
Package

path-string.util.

Source

util.lisp.

Function: posix-join-components (components)
Package

path-string.util.

Source

util.lisp.

Function: posix-split-path (path)
Package

path-string.util.

Source

util.lisp.

Function: relative (from to)

Solve the relative path from FROM to TO.

Package

path-string.posix.

Source

posix.lisp.

Function: resolve (&rest paths)

Resolves the last argument to an absolute path

Package

path-string.posix.

Source

posix.lisp.

Function: trim-list (list)
Package

path-string.util.

Source

util.lisp.


Appendix A Indexes


A.1 Concepts