| View previous topic :: View next topic |
| Author |
Message |
thsock
Joined: 25 Sep 2005 Posts: 25
|
Posted: Tue Oct 11, 2005 11:54 am Post subject: File browser |
|
|
Is there a tutorial somewhere on writing a file browser? I know Mike Haggar and several others have already done it.
Thanks. |
|
| Back to top |
|
 |
thsock
Joined: 25 Sep 2005 Posts: 25
|
Posted: Tue Oct 11, 2005 12:00 pm Post subject: |
|
|
Ok lol(really easy) i figured out how to list the current directory, but how do i list the contents of the directory?\
OSi 2.0 on the way |
|
| Back to top |
|
 |
KawaGeo
Joined: 27 Aug 2005 Posts: 191 Location: Calif Mountains
|
Posted: Wed Oct 12, 2005 1:48 am Post subject: |
|
|
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. _________________ Geo Massar
Retired Engineer |
|
| Back to top |
|
 |
MagicianFB
Joined: 10 Oct 2005 Posts: 11
|
Posted: Wed Oct 12, 2005 11:54 am Post subject: |
|
|
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:
| Code: |
contents = System.listDirectory("ms0:/")
for k in ipairs(contents) do
print(contents[k].name)
end
|
|
|
| Back to top |
|
 |
KawaGeo
Joined: 27 Aug 2005 Posts: 191 Location: Calif Mountains
|
Posted: Wed Oct 12, 2005 1:15 pm Post subject: |
|
|
Is that all, just three indices? What about dates? I wonder. _________________ Geo Massar
Retired Engineer |
|
| Back to top |
|
 |
MagicianFB
Joined: 10 Oct 2005 Posts: 11
|
Posted: Wed Oct 12, 2005 7:35 pm Post subject: |
|
|
| KawaGeo wrote: | | Is that all, just three indices? What about dates? I wonder. | When you print all values of an indice by doing the following:
| Code: | | table.foreach(contents[1], print) |
Those are the only three you get. |
|
| Back to top |
|
 |
|