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 

System.listDirectory()

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



Joined: 04 Mar 2006
Posts: 46

PostPosted: Thu Jun 15, 2006 7:07 am    Post subject: System.listDirectory() Reply with quote

Whenever I use that function, it never works the way I want it to. All I want to do is list the contents in a directory, but I just cant seem to do it. It will always return errors about stuff. Well all help is apprciated!
Back to top
View user's profile Send private message
be2003



Joined: 20 Apr 2006
Posts: 144

PostPosted: Thu Jun 15, 2006 3:07 pm    Post subject: Reply with quote

ahh... newbs cant ever read any tutorials

System.listDirectory() returns a table not a string. you can only print strings to the screen using screen:print() you must turn the table into string by listing its contents with a function. look at how it lists the connection configs in the Wlan sample, just replace the configs = Wlan.getConnectionConfigs() so it says configs = System.listDirectory and learn how to use google and dont freaking say that u did.
_________________
- be2003
blog
Back to top
View user's profile Send private message
romero126



Joined: 24 Dec 2005
Posts: 200

PostPosted: Thu Jun 15, 2006 4:46 pm    Post subject: Reply with quote

that was totally uncalled for be2003.

But heres the answer you are waiting for.

Code:


file_list = System.listDirectory()
for key, file in file_list do
print("File Name".. file.name.." : ".. file.size)
if (file.directory()) then
-- this is where you put directory stuff

end


end


for more information about system directorys please refer to the LUA refrence tutorial http://wiki.ps2dev.org/psp:lua_player:functions#system please bookmark this link
Back to top
View user's profile Send private message
cools



Joined: 04 Mar 2006
Posts: 46

PostPosted: Fri Jun 16, 2006 1:22 am    Post subject: Reply with quote

Thanks romero126!
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