KScript docs
EN

file_path fields and methods

A field is a plain fact about the value, read with a dot and no brackets: $value.name. A method takes arguments or does work, and is called with ->: $value->name(arguments), or with the value piped in: $value |> name(arguments).

Fields

FieldTypeDescription
.extensionstringThe extension after the last dot, without the dot: pdf in ./reports/summary.pdf, or '' when there is none.
.folderfile_pathThe path of the folder it is in: ./reports for ./reports/summary.pdf, and null for ./ itself.
.namestringThe last name, extension included: summary.pdf in ./reports/summary.pdf.
.segmentslistThe names in order, as written: ['.', 'reports', 'summary.pdf'] for ./reports/summary.pdf.
.stemstringThe last name without its extension: summary in ./reports/summary.pdf, summary.final in summary.final.pdf.

Methods from any

Methods from string