This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Exerro's profile picture

[question] printing directory contents

Started by Exerro, 27 June 2012 - 08:10 PM
Exerro #1
Posted 27 June 2012 - 10:10 PM
I'm trying to make a file browser and I've looked around and found nothing helpful…I'm not sure how to print the files in directories using -files = fs.list("rom")- because it just returns a table and idk how to look in the whole computer for all files and directories…
any help?
kazagistar #2
Posted 27 June 2012 - 11:22 PM
print(textutils.tabulate(fs.list(rom)))
Mads #3
Posted 29 June 2012 - 06:40 PM
Wrong. Don't forget to use quotes around strings. It would be like so:

print( textutils.tabulate( fs.list( "/rom" ) ) )
MysticT #4
Posted 29 June 2012 - 08:57 PM
Actually, it would be just:

textutils.tabulate(fs.list("/rom"))
since tabulate prints the table contents, it doesn't return anything.