QJ.NET | Videos | Forums | iPhone | MMORPG | Nintendo DS | Wii | PlayStation 3 | PSP | Xbox 360 | PC | Downloads | Contact Us
Forums | Gaming News | Videos | Downloads | Today's Posts | Mark Forums Read | Chat | FAQ | Members List | Contact

QJ.net Game Discussion - PSP, Xbox, Wii, PS3, PSP Homebrew, and PSP Guides

Go Back   QJ.net Game Discussion - PSP, Xbox, Wii, PS3, PSP Homebrew, and PSP Guides > Developers Corner > PSP Development, Hacks, and Homebrew > PSP Development Forum
The above video goes away if you are a member and logged in, so log in now!

System.listCurrentDirecto ry() help (lua)

This is a discussion on System.listCurrentDirecto ry() help (lua) within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; Ok I'm tryin to get this thing to work, I want a little script that lists everything in the current ...

Reply
 
LinkBack Thread Tools
Old 11-24-2006, 05:04 PM   #1
 
Join Date: Aug 2006
Posts: 1,633
Trader Feedback: 0
Default System.listCurrentDirecto ry() help (lua)

Ok I'm tryin to get this thing to work, I want a little script that lists everything in the current directory and prints it to the screen but does nothing else. I also want to be able to understand it. Whoever helps me out may or may not recieve some P01/\/T$.
TacticalPenguin is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-24-2006, 08:14 PM   #2

Developer
 
Join Date: Jul 2006
Posts: 205
Trader Feedback: 0
Default

This is what I used, because the example in the wiki is not very clear:

Code:
filelist=System.listDirectory()
numfiles=table.getn(filelist)
for k=1,numfiles do
     screen:print(10,10*k,filelist[k].name,Color.new(255,255,255))
end
Untested of course, but there shouldn't be anything in there you can't handle. Follow the link to find out what else System.listDirectory() puts in the table that it returns.

EDIT: Also, you shouldn't run System.listDirectory() in a while loop.
LMelior is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-24-2006, 08:51 PM   #3
 
Join Date: Aug 2006
Posts: 1,633
Trader Feedback: 0
Default

I was talkin to bronx on msn and lookin at a filebrowser source but i couldnt quite get it. I understand the directory commands and stuff, i just was having troubles getting it to run correctly. This works though. Thanks lmelior!
TacticalPenguin is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-24-2006, 08:54 PM   #4

.info
 
Yongobongo's Avatar
 
Join Date: Jun 2006
Location: ACT, Australia
Posts: 1,674
Trader Feedback: 0
Default

Quote:
Originally Posted by LMelior
This is what I used, because the example in the wiki is not very clear:

Code:
filelist=System.listDirectory()
numfiles=table.getn(filelist)
for k=1,numfiles do
     screen:print(10,10*k,filelist[k].name,Color.new(255,255,255))
end
Untested of course, but there shouldn't be anything in there you can't handle. Follow the link to find out what else System.listDirectory() puts in the table that it returns.

EDIT: Also, you shouldn't run System.listDirectory() in a while loop.
Thanks to you also! I used that wiki ALOT when learning LUA, and still use now for references You helped me make browsR
__________________

http://www.yongobongo.com
PSN - yongobongo
Yongobongo is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Tags
lua , systemlistcurrentdirecto

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -8. The time now is 08:55 PM.



Use of this Web site constitutes acceptance of the TERMS & CONDITIONS and PRIVACY POLICY
Copyright © 2009, QJ.NET. All Rights Reserved.
Contact Us