fs.getDir

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

Returns string
API fs
Source CC:Tweaked (source)

Returns the directory part of a file.

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