how do i list all files in a directory via file.Find?

as the title says, how do i list all files in a folder via the file.Find?

did you try reading the example?

yes and that list 2 things not all the files.

Did you try reading it again?

i sure did

Look closer.

[editline]4th November 2016[/editline]

Rating me dumb won’t help you stop being stupid.

could you stop acting like a pretentious douchebag and stop commenting on this thread, from my point of view you are not trying to help rather you are trying to be funny

Well if you could be bothered to read anything on the wiki page you would realise that file.Find returns 2 tables (files and directories). The example shows you how to access those tables.

cool, yet you never bother telling me how i should return more than 2 things i need to view all the things in a folder and obviously you haven’t ran the example on the wiki cause then you would have known it doesn’t print all the folder/files only 2, considering the 2 args[1], so you are pretty much being a dumbass :confused:

well tbf the wiki page does give you more than enough information to be able to figure this out.

file.Find returns 2 arguments, both of them are tables.
Those tables contain everything inside your folder. What’s not to understand here?

holy fuck, could you just run the code and see for urself?, if not please never comment on my thread again k thx bai.

(User was banned for this post ("Shitposting" - Bradyns))

holy fuck, could you just learn basic fucking Lua?, if not please never breath again k thx bai.

chill, you want me to die over a thread?, damn someone must have let the special education class be unsupervised again.

cool but it still doesn’t list all files and folders.

Seriously, what the fucking fuck are you babbling about? If you’d bother to fucking test it, you’d see that file.Find() returns two tables, one contains list of all subdirectories and another contains list of files.

Imma just say what we all know but won’t say because nobody wants to spoonfeed him.

In the wiki example, they use files[1] and directories[1]. For some reason, this made you think you only get 1 value in each table? Just add PrintTable( files ) and PrintTable( directories ) to that code, and you’ll see we’re right

just kidding

Don’t come asking for help if you’re acting like this, we don’t want to help people when theyre like this. If you had been nice I’m sure someone would have written that 3 lines of code to print all files, but because of your behaviour nobody is going to be nice and write that.