$FUNCNAME$
  DIRECTORY()
$CATEGORY$
  SYSTEM,FILE/IO,ARRAY
$SUMMARY$
   Create an array of directory and file information
$LANG_RU$
          .
$SYNTAX$
     DIRECTORY(<cDirSpec>, [<cAttributes>]) --> aDirectory
$LANG_RU$
     DIRECTORY(< >,[<>]) ->  
$ARGUMENTS$
     <cDirSpec> identifies the drive, directory and file specification
     for the directory search.  Wildcards are allowed in the file
     specification.  If <cDirSpec> is omitted, the default value is *.*.

     <cAttributes> specifies inclusion of files with special attributes
     in the returned information.  <cAttributes> is a string containing one
     or more of the following characters:

     <PRE>DIRECTORY() Attributes
     ------------------------------------------------------------------------
     Attribute    Meaning
     ------------------------------------------------------------------------
     H            Include hidden files
     S            Include system files
     D            Include directories
     V            Search for the DOS volume label and exclude all other files
     ------------------------------------------------------------------------
     </PRE>

     Normal files are always included in the search, unless you specify V.
$LANG_RU$
     < > -  ,   
       .    .
       < >  ,   
     (*.*).

      <>     
         .  <>  
     ,     ,   

     <PRE>  DIRECTORY().
     ---------------------------------------------------------------------
            
     ---------------------------------------------------------------------
     H               
     S               
     D               
     V                DOS.    
     ---------------------------------------------------------------------
     </PRE>

           ,  
        V.
$RETURNS$
     DIRECTORY() returns an array of subarrays, with each subarray containing
     information about each file matching <cDirSpec>.  The subarray has the
     following structure:

     <PRE>DIRECTORY() Subarray Structure
     ------------------------------------------------------------------------
     Position     Metasymbol     Directry.ch
     ------------------------------------------------------------------------
     1            cName          F_NAME
     2            cSize          F_SIZE
     3            dDate          F_DATE
     4            cTime          F_TIME
     5            cAttributes    F_ATTR
     ------------------------------------------------------------------------
     </PRE>

     If no files are found matching <cDirSpec> or if <cDirSpec> is an illegal
     path or file specification, DIRECTORY() returns an empty ({}) array.
$LANG_RU$
     DIRECTORY()  ,     
     ,     ,  
        < >.   
     :

     <PRE>   DIRECTORY().
     ---------------------------------------------------------------------
                          Directry.ch
     ---------------------------------------------------------------------
       1               cName                 F_NAME
       2               nSize                 F_SIZE
       3               dDate                 F_DATE
       4               cTime                 F_TIME
       5               cAttributes           F_ATT
     ---------------------------------------------------------------------
     </PRE>

        ,  < >,  
     < >      
     ,   DIRECTORY()   ({}) .
$DESCRIPTION$
     DIRECTORY() is an environment function that returns information about
     files in the current or specified directory.  It is similar to ADIR(),
     but returns a single array instead of adding values to a series of
     existing arrays passed by reference.

     Use DIRECTORY() to perform actions on groups of files.  In combination
     with AEVAL(), you can define a block that can be applied to all files
     matching the specified <cDirSpec>.

     The header file, Directry.ch, in the \include subdirectory
     contains #defines for the subarray subscripts, so that the references to
     each file subarray are more readable.
$LANG_RU$
     DIRECTORY() -   ,    
          .    ADIR(), 
         ,    
       ,   .

     DIRECTORY()       .
       ,     ,  
        < >,  
     DIRECTORY()     AEVAL().

            
     xClipper    directory.ch,   
     \include,    .
$EXAMPLES$
       This example creates an array of information about files in
	the current directory and then lists the names of the files using
	AEVAL() and QOUT():

	#include "directry.ch"
	//
	aDirectory := DIRECTORY("*.*", "D")
	AEVAL( aDirectory, {|aFile| QOUT(aFile[F_NAME])} )
$LANG_RU$
               
       ,       . 
          AEVAL()  QOUT():


	  #include "directry.ch"
	  //
	  aDirectory := DIRECTORY("*.*", "D")
	  AEVAL( aDirectory, { | aFile | QOUT( aFile[F_NAME]) } )
$SEEALSO$
  AEVAL()
$END$
