parsePath
Splits a file path into folder, name, stem, extension, exists and isFolder.
Details #
parsePath(text) expands a leading ~ and returns a record: folder (the path without the last part), name (report.final.pdf), stem (report.final), extension (pdf), exists and isFolder (read from the disk when the function runs).
Parameters #
Takes 1 argument.
{{ parsePath(text) }}
Examples #
parsePath("~/Documents/report.pdf").name→
report.pdfparsePath("/tmp").isFolder→
trueGotchas #
It reads the disk for
existsandisFolder, so a preview shows it as needing a real run.A file with no dot has an empty
extension.