News : The level of daily SPAM has reached insane proportions, all registrations are now manual. I ask you to send me an e-mail (john (at) murga (dot) org), to confirm that you want me to create an account for you.

Post Reply  Post Thread 
best way to list filenames in Lua?
Author Message
Senior Member

Posts: 522
Group: Registered
Joined: Apr 2007
Status: Offline
Reputation: 5
Post: #1
RE: best way to list filenames in Lua?

okie dokie...
To grab the filenames of all *.txt files in a given directory, this seems to be the most effective way:
for i=1,table.maxn(allfiles) do
if string.find(allfiles[i],"%.txt$") then print(allfiles[i]) end

Apparently table.getn(table) has the same result as table.maxn(table)
I dunno if one is actually better than the other.

06-08-2007 09:33 AM
Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

Messages In This Thread
RE: best way to list filenames in Lua? - mikshaw - 06-08-2007 09:33 AM

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump: