file-extension ( path -- extension )
Factor handbook » Input and output » Pathnames

Prev:file-stem ( path -- stem )
Next:path-components ( path -- seq )


Vocabulary
io.pathnames

Inputs
patha pathname string


Outputs
extensiona string


Word description
Outputs the extension of path, or f if the filename has no extension.

Examples
USING: io.pathnames prettyprint ; "/usr/bin/gcc" file-extension .
f

USING: io.pathnames prettyprint ; "/home/csi/gui.vbs" file-extension .
"vbs"


See also
file-name, file-stem

Definition