Skip to content

Modern Fs PathFileName

Paul Squires edited this page Oct 19, 2026 · 5 revisions

Home › Filesystem › Filesystem Library › PathFileName

PathFileName

Returns the last part of a path, the file name, or an empty string for a root.

Syntax

PathFileName( p )

Notes

  • the leaf; "" for a root

Examples

#import "std/fs"
using fs

print PathFileName( "C:\dev\src\main.tiko" )       '' main.tiko
print PathFileName( "main.tiko" )                  '' main.tiko

'' Empty for a root: there is no leaf there
print "[" & PathFileName( "C:\" ) & "]"           '' []

Library: Filesystem Library
Category: Filesystem
Documented under: Paths

Clone this wiki locally