System.listDirectory()
Moderators: Shine, Insert_witty_name
System.listDirectory()
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!
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.
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
blog
that was totally uncalled for be2003.
But heres the answer you are waiting for.
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
But heres the answer you are waiting for.
Code: Select all
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