Jump to content




[question] printing directory contents


  • You cannot reply to this topic
3 replies to this topic

#1 Exerro

  • Members
  • 801 posts

Posted 27 June 2012 - 09: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?

#2 kazagistar

  • Members
  • 365 posts

Posted 27 June 2012 - 10:22 PM

print(textutils.tabulate(fs.list(rom)))

#3 Mads

  • Members
  • 604 posts
  • LocationCopenhagen, Denmark

Posted 29 June 2012 - 05:40 PM

Wrong. Don't forget to use quotes around strings. It would be like so:
print( textutils.tabulate( fs.list( "/rom" ) ) )


#4 MysticT

    Lua Wizard

  • Members
  • 1,597 posts

Posted 29 June 2012 - 07:57 PM

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





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users