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

Pastebin Package Maker - Help

Started by Dave-ee Jones, 22 September 2013 - 01:19 AM
Dave-ee Jones #1
Posted 22 September 2013 - 03:19 AM
Heya, AutoLocK here.

So I was thinking about package makers, and I was wondering if this idea of mine would work. The only thing is, I am not sure how I should do it.

So say you have the program already done, this is how it would work:

packagemaker <directory>

Basically, the package maker should read the directory and all the files in it. Then, it will upload all the files to pastebin and collect all the pastebin codes. It will create a new file that contains all the pastebin codes and once that file has been run, it will download and install all the programs into a directory.

The thing I am not sure about is reading a directory and how to read all the files in it and collect the data, when you have no idea how many files are in the directory and what their names are.

Help?
Lyqyd #2
Posted 22 September 2013 - 03:24 AM
fs.list returns a table of all the file and directory names at whatever path you pass it. Simply iterate that table and act accordingly.
Dave-ee Jones #3
Posted 22 September 2013 - 03:28 AM
fs.list returns a table of all the file and directory names at whatever path you pass it. Simply iterate that table and act accordingly.

Ok. Thanks Lyqyd! I did not think of using fs.list.
Even if I did, I probably never would have found out how to use it :P/>

Ima play around with the fs.list first and then see what I can do with the package maker.

Thanks again :D/>