fs.getName

From ComputerCraft
Jump to navigation Jump to search

fs.getName
Function
Syntax
fs.getName()
Returns string
API fs
Source CC:Tweaked (source)

Returns the filename part of a path.

ExampleExampleGet the filename
Get the filename of the path "/rom/programs/shell.lua" and print it.
Code
print(fs.getName("/rom/programs/shell.lua"))
Output
shell.lua