Jump to content

Check folder and return file names in folder


harryh

Recommended Posts

Posted

Would it be possible for me to check what files are  in a folder and save them in a table

For example:

local files = {}

fileCheck("/mods")

returns

all files in folder

tableinsert(files, server.lua)

tableinsert(files,client.lua)

tableinsert(files,text.dff)

tableinsert(files,meta.xml)

tableinsert(files,color.txd)

Posted
6 minutes ago, 3laa33 said:

fileExists ( string filePath )

 

I mean without needing to put a file path like.

like 

its I type fileExists(/mods/*) will it return file names for all in directory

 

Posted

I don't think that's possible, at least I can't find a function and also have never seen it done.
If you want to save some sort of dynamic files you will either have to make a list of them e.g. create a files.txt/xml and add a file name every time you create a file.
Or have the names in some sort of relation, e.g map name, player account, etc.
Whichever fits better for what you are planning.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...