Here’s how to use directory() function.
Description:
List the file name(s) satisfying a wildcard path.
Syntax:
directory(path)
Note:
The function lists file name(s) satisfying wildcard path path, excluding the path names.
Parameter:
| 
   path  | 
  
  
   Wildcard path, * represents 0 or multiple characters, and ? represents a single character.  | 
  
 
Option:
| 
   @d  | 
  
  
   List the subdirectory of path.  | 
  
 
| 
   @p  | 
  
  
   Return files with full paths under the directory.  | 
  
 
| 
   @m  | 
  
  
   Create a directory.  | 
  
 
| 
   @r  | 
  
  
   Delete a directory, which must be empty.  | 
  
 
| 
   @s  | 
  
  
   Perform recursive query to get all file names under all subdirectories; mutually exclusive with @m and @r.  | 
  
 
| 
   @c  | 
  
  
   Make case-insensitive; without it the OS will have a say.  | 
  
 
Return value:
Sequence
Example:
| 
   
  | 
  
  
   A  | 
  
  
   
  | 
  
 
| 
   1  | 
  
  
   =directory("D://*.txt")  | 
  
  
   Return the txt file list under the root directory on driver D.  | 
  
 
| 
   2  | 
  
  
   =directory@d("D://tomcat5")  | 
  
  
   List the subdirectory under the tomcat5 directory.  | 
  
 
| 
   3  | 
  
  
   =directory@m("D://test")  | 
  
  
   Create test folder under the root directory on driver D.  | 
  
 
| 
   4  | 
  
  
   =directory@r("D://test")  | 
  
  
   Delete D://test directory, but the test folder must be empty.  | 
  
 
| 
   5  | 
  
  
   =directory@s("D://tomcat5")  | 
  
  
   Return a list of files in subdirectories under the tomcat5 directory.  | 
  
 
| 
   6  | 
  
  
   =directory@p("D://tomcat5")  | 
  
  
   List full path of files under tomcat5 directory.  | 
  
 
| 
   7  | 
  
  
   =directory@c("d://TOMCAT5/*.txt")  | 
  
  
   List txt files under tomcat5 directory; must be case-insensitive.  | 
  
 
Related functions: