fs.getName

fs.getName
Function
Syntax
fs.getName(
  • path : string
)

Returns string
API fs
Source CC:Tweaked (source)

Returns the filename part of a path.

ExampleGet the filename
Get the filename of the path "/rom/programs/shell.lua" and print it.
Code
<nowiki>
print(fs.getName("/rom/programs/shell.lua"))
    </nowiki>
Output
<nowiki>
shell.lua
</nowiki>
This article is issued from Computercraft. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.