File.FindFiles
Skip to content
mnscript
string[] File.FindFiles(string) 

Description ​

Returns an array of files in the given directory.

Arguments ​

string - The directory to search.

Returns ​

string[] - An array of files found in the directory.

Example ​

msc
using File;
using Console;
using Array;
using Util;

// Finds the files in "r/documents" and prints them to console.

string[] files = File.FindFiles("r/documents");
number numFiles = Array.Length(files);
number fileIndex = 1;

Console.WriteLine("Found "..Util.ToString(numFiles).." files!");

while(fileIndex <= numFiles){
    Console.WriteLine("File: "..files[fileIndex]);
    fileIndex = fileIndex + 1;
}