This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
MarioBG's profile picture

Count elements in a folder

Started by MarioBG, 27 June 2012 - 09:54 PM
MarioBG #1
Posted 27 June 2012 - 11:54 PM
Hello, I'm kinda beginner to programming, but I have already started a little bank management system for a server. The point is, I would highly appreciate some code that counted the number of accounts (every account is a separate file in a folder called "secure") registered in the system. I would post the code I have written by now but I'm afraid it's in Spanish, because I am also Spanish. Could you please solve this little problem of mine? Thanks in advance! Oh, and if you needed it, I wouldn't mind posting what I have done by now of the program itself anyway :P/>/> . Thanks!
MysticT #2
Posted 28 June 2012 - 12:00 AM
You can use this:

local count = #fs.list("PathHere")
Not tested, but it should work.
MarioBG #3
Posted 03 July 2012 - 12:11 AM
Thanks Mystic, it works perfectly! Now i'm able to make my project of bursatile system! Thanks a lot!