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

any advice on listing files and directories in a table?

Started by dylan, 09 April 2012 - 09:37 PM
dylan #1
Posted 09 April 2012 - 11:37 PM
Like the "list" program instead I would like it in a table and I would like to format it in my custom OS.

thanks!
MysticT #2
Posted 09 April 2012 - 11:40 PM
The best advice that comes to my mind: check the list program source to know how it works. It actually gets the files and directories in a table (fs.list(path) returns a table) and then sorts it.
dylan #3
Posted 09 April 2012 - 11:44 PM
The best advice that comes to my mind: check the list program source to know how it works. It actually gets the files and directories in a table (fs.list(path) returns a table) and then sorts it.

thats what I would do without wasting your time but I don't have access to the source because I am using Tekkit and when I run the command "edit list" the program is empty.

also thank you for not just giving me the code. I prefer to learn the syntax and proper use through documentation.
Advert #4
Posted 10 April 2012 - 12:03 AM
You can't edit list, because it doesn't exist (in the root directory).

You need to edit the file, which is located in:

rom/programs/
dylan #5
Posted 10 April 2012 - 12:08 AM
You can't edit list, because it doesn't exist (in the root directory).

You need to edit the file, which is located in:

rom/programs/

doh! I should've known that. thank you for clearing that up.