Is there a way to return the total number of files in a folder? I don't need to know what these files are or what they contain, but just how many are in the folder. Thanks

No it does not appear that function is supported. You could do it with native OS calls, but you'd have to support each platform you export to.

Wait, there is a way, but you have to do it manually.

func list_files_in_directory(path):
    var files = []
    var dir = Directory.new()
    dir.open(path)
    dir.list_dir_begin()

    while true:
        var file = dir.get_next()
        if file == "":
            break
        elif not file.begins_with("."):
            files.append(file)

    dir.list_dir_end()

    return files

    cybereality
    If you wanted to get hidden files in linux systems as well, I believe you have to replace:
    elif not file.begins_with(".")
    with:
    elif file != ".." && file != "."
    I am on day 5 with no 5hr+ sleep, it's very likely I'm missing something obvious.
    (you could do and instead of &&. i prefer the &&)

    cybereality I should have figured. I knew that code looked familiar. Besides that, didn't you say you never use while true?

    It says that directory is not declared in the current scope. It asks if I meant DirAccess so I put that in instead of Directory but then it can't be constructed because it is abstract