.. highlightlang:: us .. index:: GetDirectory .. _getdirectory: GetDirectory ============ .. us.tag GetDirectory ENGLISH FILE_MISC New300 Changed411 The :ref:`GetDirectory` function returns a string vector with file names. If *bRecurseSubDirs* is TRUE (1) it returns also the file names found in sub-directories. The function does not return directory names. .. function:: svFileNames = GetDirectory(ssSearch) svFileNames = GetDirectory(ssSearch, bRecurseSubDirs) svFileNames = GetDirectory(ssSearch, bRecurseSubDirs, ssCallback) .. us.return **Return Value** *svFileNames* is a string vector with complete file names. If the function could not find any files an empty string is returned (""). .. us.params **Parameters** .. uparam:: ssSearch The *ssSearch* parameter may use wildcards (``*`` and ``?``). Example :file:`c:\\*.xls`. .. uparam:: bRecurseSubDirs If *bRecurseSubDirs* is TRUE (1) a sub directory will be included in the search. Default value is FALSE (0). .. uparam:: ssCallback Name of a Callback function. The function will be invoked for each file found. The callback function has three parameters:: my_dir_callback(bDir, ssFile, files) **bDir**: TRUE (1) if the second paramter is a directory and otherwise FALSE (0). **ssFile**: File of directory name. **files**: An object created with :ref:`obj_create` to save the files. See example. .. us.example **Example** The following call creates a string vector of all IPW files for the given directory :: * GetDirectory("c:/programme/uniplot/samples/*.ipw", 1) c:/programme/uniplot/samples/sample.ipw c:/programme/uniplot/samples/template.ipw c:/programme/uniplot/samples/automate/example.ipw c:/programme/uniplot/samples/automate/vollast.ipw :: def my_dir_callback(bDir, ssFile, files) { if (bDir) { AppSetStatusBarText(ssFile); } else { files[ssFile] = 1; } } :: * GetDirectory("c:/programme/uniplot/samples/*.ipw", 1, "my_dir_callback") c:/programme/uniplot/samples/sample.ipw c:/programme/uniplot/samples/template.ipw c:/programme/uniplot/samples/automate/example.ipw c:/programme/uniplot/samples/automate/vollast.ipw .. seealso:: :ref:`overview-files`, :ref:`FindFiles`, :ref:`GetFileAttributes`, :ref:`SplitPath` :sub:`id-1233954`