Path

Config & IO

Filesystem path string helpers for the BEAM target.

These operate on path strings the same way OTP filename does — they do not touch the filesystem. Use File for reads, writes, and directory listing.

Values

join

join : String -> String -> String

Join two path segments with the platform separator.

Examples

Path.join "static" "app.js"

joinAll

joinAll : List String -> String

Join path segments left-to-right.

Examples

Path.joinAll [ "priv", "static", "app.js" ]

dirname

dirname : String -> String

Parent directory of path (. when there is none).

Examples

Path.dirname "/tmp/app.js"

basename

basename : String -> String

Final component of path.

Examples

Path.basename "/tmp/app.js"

extension

extension : String -> String

Extension without the leading . (empty string when none).

Examples

Path.extension "app.js"

dropExtension

dropExtension : String -> String

Path with the final extension removed.

Examples

Path.dropExtension "app.js"

isAbsolute

isAbsolute : String -> Bool

True when path is absolute on this host.

Examples

Path.isAbsolute "/tmp"