ClassesClassesClassesClasses | | | | Operators

list_filesT_list_filesListFileslist_filesListFilesListFiles (Operator)


list_filesT_list_filesListFileslist_filesListFilesListFiles — List all files in a directory.


list_files( : : Directory, Options : Files)

Herror T_list_files(const Htuple Directory, const Htuple Options, Htuple* Files)

Herror list_files(const HTuple& Directory, const HTuple& Options, HTuple* Files)

void ListFiles(const HTuple& Directory, const HTuple& Options, HTuple* Files)

static HTuple HMisc::ListFiles(const HString& Directory, const HTuple& Options)

static HTuple HMisc::ListFiles(const HString& Directory, const HString& Options)

static HTuple HMisc::ListFiles(const char* Directory, const char* Options)

void HOperatorSetX.ListFiles(
[in] VARIANT Directory, [in] VARIANT Options, [out] VARIANT* Files)

VARIANT HMiscX.ListFiles(
[in] BSTR Directory, [in] VARIANT Options)

static void HOperatorSet.ListFiles(HTuple directory, HTuple options, out HTuple files)

static HTuple HMisc.ListFiles(string directory, HTuple options)

static HTuple HMisc.ListFiles(string directory, string options)


list_fileslist_filesListFileslist_filesListFilesListFiles returns all files in the directory given by DirectoryDirectoryDirectoryDirectoryDirectorydirectory in the parameters FilesFilesFilesFilesFilesfiles. The current directory can be specified with ''"""""""""" or '.'".""."".""."".". The parameter OptionsOptionsOptionsOptionsOptionsoptions can be used to specify different processing options by passing a tuple of values. If OptionsOptionsOptionsOptionsOptionsoptions contains 'files'"files""files""files""files""files" only the files present in DirectoryDirectoryDirectoryDirectoryDirectorydirectory are returned. If 'directories'"directories""directories""directories""directories""directories" is passed, only the directories present in DirectoryDirectoryDirectoryDirectoryDirectorydirectory are returned. Directories are marked by a trailing '\'"\""\""\""\""\" (Windows) or a trailing '/'"/""/""/""/""/" (Unix-like systems). If files as well as directories should be returned, ['files','directories']["files","directories"]["files","directories"]["files","directories"]["files","directories"]["files","directories"] must be passed. If neither 'files'"files""files""files""files""files" nor 'directories'"directories""directories""directories""directories""directories" is passed, list_fileslist_filesListFileslist_filesListFilesListFiles returns an empty tuple. By passing 'recursive'"recursive""recursive""recursive""recursive""recursive", it can be specified that the directory tree should be searched recursively by examining all sub-directories. On Unix-like systems, 'follow_links'"follow_links""follow_links""follow_links""follow_links""follow_links" can be used to specify that symbolic links to files or directories should be followed. In the default setting, symbolic links are not dereferenced, and hence are not searched if they point to directories, and not returned if they point to files. For the recursive search, a maximum search depth can be specified with 'max_depth <d>'"max_depth <d>""max_depth <d>""max_depth <d>""max_depth <d>""max_depth <d>", where '<d>'"<d>""<d>""<d>""<d>""<d>" is a number that specifies the maximum depth. Hence, 'max_depth 2'"max_depth 2""max_depth 2""max_depth 2""max_depth 2""max_depth 2" specifies that DirectoryDirectoryDirectoryDirectoryDirectorydirectory and all immediate sub-directories should be searched. If symbolic links should be followed it might happen that the search does not terminate if the symbolic links lead to a cycle in the directory structure. Because of this, at most 1000000 files (and directories) are returned in FilesFilesFilesFilesFilesfiles. By specifying a different number with 'max_files <d>'"max_files <d>""max_files <d>""max_files <d>""max_files <d>""max_files <d>", this value can be reduced.



DirectoryDirectoryDirectoryDirectoryDirectorydirectory (input_control)  filename.dir HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Name of directory to be listed.

OptionsOptionsOptionsOptionsOptionsoptions (input_control)  string(-array) HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Processing options.

Default value: 'files' "files" "files" "files" "files" "files"

Suggested values: 'files'"files""files""files""files""files", 'directories'"directories""directories""directories""directories""directories", 'recursive'"recursive""recursive""recursive""recursive""recursive", 'follow_links'"follow_links""follow_links""follow_links""follow_links""follow_links", 'max_depth 5'"max_depth 5""max_depth 5""max_depth 5""max_depth 5""max_depth 5", 'max_files 1000'"max_files 1000""max_files 1000""max_files 1000""max_files 1000""max_files 1000"

FilesFilesFilesFilesFilesfiles (output_control)  string-array HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Found files (and directories).


list_fileslist_filesListFileslist_filesListFilesListFiles returns the value 2 (H_MSG_TRUE) if the directory exists and could be read. Otherwise, an exception is raised.

Possible Successors




ClassesClassesClassesClasses | | | | Operators