FileSystem.Path
A path represents the location of a file or directory in a filesystem.
A cross-platform representation of a filesystem path.
If root
is empty, it means that the path is relative to the working directory.
On posix-compatible systems (Linux, Mac...), the root value is "/" if not empty.
On Windows, the root refers to the specific disk that the path applies to.
filename
(and extension
) refers to the last part of a path. It can still
represent a directory.
Constructors
Build a Path from a String
. The String
should represent a Posix-compatible path.
String representation of a Path for Posix systems.
Build a Path from a String
. The String
should represent a Windows-compatible path.
String
representation of a Path for Windows.
Query
Return the filename and file extension for a Path.
"/home/me/file.md"
|> fromPosixString
|> filenameWithExtension
-- returns "file.md"
Return a Path that represents the directory which holds the given Path
"/home/me/file.md"
|> fromPosixString
|> parentPath
-- returns (Just "/home/me")
Manipulation
Join all paths in an Array
.