Is there a tutorial somewhere on writing a file browser? I know Mike Haggar and several others have already done it.
Thanks.
File browser
Moderators: Shine, Insert_witty_name
I don't think there is such a documentation regarding the output of current directory function. All I know is that the output is a list of "subtables" and a few members. Only source I could find for more info is in Lowser. script.
Someone needs to doc the table structure for the output.
Someone needs to doc the table structure for the output.
Geo Massar
Retired Engineer
Retired Engineer
-
- Posts: 11
- Joined: Mon Oct 10, 2005 8:45 am
Each indice of the results of System.listDirectory(), has three parts.
name: the name of the file
size: the size of the file in bytes
directory: a boolean saying whether the file is a directory/folder
heres a quick example of a code to display the names all files on the root of the memory stick:
name: the name of the file
size: the size of the file in bytes
directory: a boolean saying whether the file is a directory/folder
heres a quick example of a code to display the names all files on the root of the memory stick:
Code: Select all
contents = System.listDirectory("ms0:/")
for k in ipairs(contents) do
print(contents[k].name)
end
-
- Posts: 11
- Joined: Mon Oct 10, 2005 8:45 am
When you print all values of an indice by doing the following:KawaGeo wrote:Is that all, just three indices? What about dates? I wonder.
Code: Select all
table.foreach(contents[1], print)