.. highlightlang:: us .. index:: FindFiles .. _findfiles: FindFiles ========= .. us.tag FindFiles ENGLISH FILE_MISC The :ref:`FindFiles` function returns a string matrix with file names and other file information. .. function:: smFiles = FindFiles(ssMatch) .. us.return **Return Value** *smFiles* is a string matrix with three columns. If the function could not find any files, an empty string is returned (""). .. list-table:: :header-rows: 1 * - Value - Meaning * - smFiles[;1] - The first column contains the complete file names. * - smFiles[;2] - The second column contains the file size in bytes. * - smFiles[;3] - The third column contains the file attributes (see :ref:`GetFileAttributes`). .. us.params **Parameters** .. uparam:: ssMatch The *ssMatch* parameter may use wildcards (* and ?). Example: ``"c:/*.xls"``. .. us.example **Example** The following functions returns the names of all sub directories. :: def GetDirNames(ssDir) { smInfo = FindFiles(ssDir + "/*"); rvAttrib = strtod(smInfo[;3]); idx = find(rvAttrib & 16); if (idx[1] != 0) { svDir = smInfo[idx;1]; // remove "." and ".." idx = find(svDir != "." && svDir != ".."); if (idx[1] != 0) { return svDir[idx]'; } } return ""; } .. seealso:: :ref:`overview-files`, :ref:`GetDirectory`, :ref:`GetFileAttributes` :sub:`id-4577`