Std\Path
Path – file path manipulation.
Pure string-based path operations for joining, splitting, and inspecting file paths. No filesystem access is performed.
Functions
Section titled “Functions”join : String -> String -> String
Section titled “join : String -> String -> String”Join two path components with the platform separator.
import join from Std\Path injoin "/home/user" "docs" # => "/home/user/docs"dirname : String -> String
Section titled “dirname : String -> String”Return the directory portion of a path.
import dirname from Std\Path indirname "/home/user/file.txt" # => "/home/user"basename : String -> String
Section titled “basename : String -> String”Return the filename portion of a path.
import basename from Std\Path inbasename "/home/user/file.txt" # => "file.txt"extension : String -> String
Section titled “extension : String -> String”Return the file extension including the dot.
import extension from Std\Path inextension "photo.jpg" # => ".jpg"withExtension : String -> String -> String
Section titled “withExtension : String -> String -> String”Replace the file extension with a new one.
import withExtension from Std\Path inwithExtension "data.csv" ".json" # => "data.json"isAbsolute : String -> Bool
Section titled “isAbsolute : String -> Bool”Returns true if the path is absolute.
import isAbsolute from Std\Path inisAbsolute "/usr/bin" # => trueisAbsolute "src/main" # => false