fs.getDir
From ComputerCraft Wiki
Revision as of 21:32, 16 April 2014 by MKlegoman357 (Talk | contribs) (Created page with "{{lowercase}} {{Function |name=fs.getDir |args={{Type|string}} path |api=fs |returns={{Type|string}} parent directory |addon=ComputerCraft |desc=Returns the parent directory o...")
Function fs.getDir | |
Returns the parent directory of path. This is the directory a file/folder is in. | |
Syntax | fs.getDir(string path) |
Returns | string parent directory |
Part of | ComputerCraft |
API | fs |
Examples
Example | |
Prints the directory 'edit' program is in. | |
Code |
print(fs.getDir("rom/programs/edit")) |
Output | rom/programs |