fs.getName
From ComputerCraft Wiki
Function fs.getName | |
Returns the last path component (forward-slash-separated) component of a path (which need not exist) | |
Syntax | fs.getName(string path) |
Returns | string the last path component of the path, or the string "root" if the path refers to the root directory |
Part of | ComputerCraft |
API | fs |
Examples
Example | |
Gets the last path component of a file | |
Code |
print(fs.getName("rom/apis/colors")) |
Output | colors |