fs.list

From ComputerCraft Wiki
Revision as of 03:46, 12 March 2012 by Hawk777 (Talk | contribs) (Add a description)

Jump to: navigation, search


Grid Redstone.png  Function fs.list
Returns a list of all the files contained in a directory
Syntax fs.list(string path)
Returns table list of files and folders in path, which must be a directory
Part of ComputerCraft
API fs

Examples

Grid paper.png  Example
Displays a list of all files and folders in the root directory of a computer
Code
for k, v in ipairs(fs.list("")) do
 print(v)
end
Output A list of all files and folders in the root directory