forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

File browser

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Lua Player Development
View previous topic :: View next topic  
Author Message
thsock



Joined: 25 Sep 2005
Posts: 25

PostPosted: Tue Oct 11, 2005 11:54 am    Post subject: File browser Reply with quote

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
View user's profile Send private message
thsock



Joined: 25 Sep 2005
Posts: 25

PostPosted: Tue Oct 11, 2005 12:00 pm    Post subject: Reply with quote

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
View user's profile Send private message
KawaGeo



Joined: 27 Aug 2005
Posts: 191
Location: Calif Mountains

PostPosted: Wed Oct 12, 2005 1:48 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
MagicianFB



Joined: 10 Oct 2005
Posts: 11

PostPosted: Wed Oct 12, 2005 11:54 am    Post subject: Reply with quote

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
View user's profile Send private message
KawaGeo



Joined: 27 Aug 2005
Posts: 191
Location: Calif Mountains

PostPosted: Wed Oct 12, 2005 1:15 pm    Post subject: Reply with quote

Is that all, just three indices? What about dates? I wonder.
_________________
Geo Massar
Retired Engineer
Back to top
View user's profile Send private message Send e-mail
MagicianFB



Joined: 10 Oct 2005
Posts: 11

PostPosted: Wed Oct 12, 2005 7:35 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Lua Player Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group