Difference between revisions of "Fs.getDir"

From ComputerCraft Wiki
Jump to: navigation, search
(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...")
 
m
 
(One intermediate revision by one other user not shown)
Line 6: Line 6:
 
|returns={{Type|string}} parent directory
 
|returns={{Type|string}} parent directory
 
|addon=ComputerCraft
 
|addon=ComputerCraft
|desc=Returns the parent directory of <var>path</var>. This is the directory a file/folder is in.
+
|desc=Returns the parent directory of <var>path</var>. This is the directory a file/folder is in. '''''Requires version 1.63 or later.'''''
 
|examples=
 
|examples=
 
{{Example
 
{{Example
Line 13: Line 13:
 
|output=rom/programs}}
 
|output=rom/programs}}
 
}}
 
}}
 +
[[Category:API Functions]]

Latest revision as of 07:58, 4 August 2020


Grid Redstone.png  Function fs.getDir
Returns the parent directory of path. This is the directory a file/folder is in. Requires version 1.63 or later.
Syntax fs.getDir(string path)
Returns string parent directory
Part of ComputerCraft
API fs

Examples

Grid paper.png  Example
Prints the directory 'edit' program is in.
Code
print(fs.getDir("rom/programs/edit"))
Output rom/programs