Directory

Directory

Build an array of Directory and file information

Syntax

      Directory( <cDirSpec>, [<cAttributes>] ) --> aDirectory

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:

          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
          ---------------------------------------------------------

Normal files are always included in the search, unless you specify V.

Returns

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

          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
          ----------------------------------------------------------

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

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 \CLIP53\INCLUDE subDirectory contains #defines for the subarray subscripts, so that the references to each file subarray are more readable.

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 ])} )

      #include "Directry.ch"

      PROC Main()

         LOCAL cFileSpec := "C:\hb32\*.*"

         LOCAL aFileList := Directory( cFileSpec, "D")

          LOCAL nMaxFNmLen := 0

         SET CENT ON
         SET DATE GERM

         AEVAL( aFileList, { | a1File | nMaxFNmLen := ;
                             MAX( nMaxFNmLen, LEN( a1File[ F_NAME ] ) ) } )

         AEVAL( aFileList, { | a1File | ;
                             QOUT( PADR( a1File[ F_NAME ], nMaxFNmLen + 1 ),;
                             TRAN( a1File[ F_SIZE ], "999,999,999" ),;
                             a1File[ F_DATE ],;
                             a1File[ F_TIME ],;
                             a1File[ F_ATTR ] ) } )

         ?
         WAIT "End of Directory.prg"

      RETU // Directory.Main()

      Result of Directory.prg :

      .                   0 13.09.2012 02:07:15 D
      ..                  0 13.09.2012 02:07:15 D
      addons              0 13.09.2012 02:07:07 D
      bin                 0 13.09.2012 02:07:12 D
      ChangeLog   8,848,829 12.09.2012 01:59:44 A
      comp                0 13.09.2012 02:07:12 D
      contrib             0 13.09.2012 02:07:16 D
      COPYING        47,456 12.09.2012 01:59:44 A
      doc                 0 13.09.2012 02:07:07 D
      extras              0 13.09.2012 02:07:15 D
      include             0 13.09.2012 02:07:07 D
      INSTALL        79,968 12.09.2012 01:59:44 A
      lib                 0 13.09.2012 02:07:14 D
      NEWS          108,058 12.09.2012 01:59:44 A
      RELNOTES        9,832 18.04.2012 04:00:10 A
      tests               0 13.09.2012 02:07:15 D
      TODO            2,924 12.09.2012 01:59:44 A
      uninstall.exe 104,646 13.09.2012 02:07:12 A

      End of Directory.prg

Seealso

ADir(), FileSeek(), HB_FileMatch()

Harbour All Functions – A

AAdd
Abs
AChoice
AClone
ACopy
ACos

ADays
AddASCII
AddMonth
ADel
ADir
AfterAtNum
AEval
AFields
AFill
AIns
Alert
Alias
AllTrim

AMonths
Array
Asc
AScan
ASCIISum
ASCPos
ASin
ASize
ASort
At
AtAdjust
ATail
ATan
ATn2
AtNum
AtRepl
AtToken

DIR

DIR

Display listings of files

Syntax

      DIR [<cFileMask>]

Arguments

<cFileMask> File mask to include in the function return. It could contain path and standard wildcard characters as supported by your OS (like * and ?). If <cFileMask> contains no path, then SET DEFAULT path is used to display files in the mask.

Description

If no <cFileMask> is given, __Dir() display information about all *.dbf in the SET DEFAULT path, this information contain: file name, number of records, last update date and the size of each file.

If <cFileMask> is given, __Dir() list all files that match the mask with the following details: Name, Extension, Size, Date.

DIR command is preprocessed into __Dir() function during compile time.

__Dir() is a compatibility function, it is superseded by DIRECTORY() which returns all the information in a multidimensional array.

Examples

      DIR          // information for all DBF files in current directory

      dir   "*.dbf"          // list all DBF file in current directory

      // list all PRG files in Harbour Run-Time library
      // for DOS compatible operating systems
        Dir  "C:\harbour\source\rtl\*.prg"

      // list all files in the public section on a Unix like machine
        Dir  "/pub"

Compliance

Clipper

Platforms

All (LFN)

Seealso

ADIR(), DIRECTORY(), SET DEFAULT, __DIR()*

ADir()

 

ADIR()

Fill pre-defined arrays with file/directory information

Syntax

      ADIR( [<cFileMask>], [<aName>], [<aSize>], [<aDate>],
            [<aTime>], [<aAttr>] ) --> nDirEnries

Arguments

<cFileMask> File mask to include in the function return. It could contain path and standard wildcard characters as supported by your OS (like * and ?). If you omit <cFileMask> or if <cFileMask> contains no path, then the path from SET DEFAULT is used.

<aName> Array to fill with file name of files that meet <cFileMask>. Each element is a Character string and include the file name and extension without the path. The name is the long file name as reported by the OS and not necessarily the 8.3 uppercase name.

<aSize> Array to fill with file size of files that meet <cFileMask>. Each element is a Numeric integer for the file size in Bytes. Directories are always zero in size.

<aDate> Array to fill with file last modification date of files that meet <cFileMask>. Each element is of type Date.

<aTime> Array to fill with file last modification time of files that meet <cFileMask>. Each element is a Character string in the format HH:mm:ss.

<aAttr> Array to fill with attribute of files that meet <cFileMask>. Each element is a Character string, see DIRECTORY() for information about attribute values. If you pass array to <aAttr>, the function is going to return files with normal, hidden, system and directory attributes. If <aAttr> is not specified or with type other than Array, only files with normal attribute would return.

Returns

ADIR() return the number of file entries that meet <cFileMask>

Description

ADIR() return the number of files and/or directories that match a specified skeleton, it also fill a series of given arrays with the name, size, date, time and attribute of those files. The passed arrays should pre-initialized to the proper size, see example below. In order to include hidden, system or directories <aAttr> must be specified.

ADIR() is a compatibility function, it is superseded by DIRECTORY() which returns all the information in a multidimensional array.

Examples

      LOCAL aName, aSize, aDate, aTime, aAttr, nLen, i
      nLen := ADir( "*.jpg" )     // Number of JPG files in this directory
      IF nLen > 0
         aName := Array( nLen )   // make room to store the information
         aSize := Array( nLen )
         aDate := Array( nLen )
         aTime := Array( nLen )
         aAttr := Array( nLen )
         ADir( "*.prg", aName, aSize, aDate, aTime, aAttr )
         FOR i := 1 TO nLen
             ? aName[ i ], aSize[ i ], aDate[ i ], aTime[ i ], aAttr[ i ]
         NEXT
      ELSE
         ? "This directory is clean from smut"
      ENDIF

Compliance

<aName> is going to be filled with long file name and not necessarily the 8.3 uppercase name.

Files

Library is rtl

Seealso

ARRAY(), DIRECTORY(), SET DEFAULT

__Dir()

Template

Function

Name

__Dir()*

Category

API

Subcategory

FileSys

Oneliner

Display listings of files

Syntax

      __Dir( [<cFileMask>] ) --> NIL

Arguments

<cFileMask> File mask to include in the function return. It could contain path and standard wildcard characters as supported by your OS (like * and ?). If <cFileMask> contains no path, then SET  DEFAULT path is used to display files in the mask.

Returns

__Dir() always returns NIL.

Description

If no <cFileMask> is given, __Dir() displays information about all *.dbf in the SET DEFAULT path. This information contains: file name, number of records, last update date and the size of each file.

If <cFileMask> is given, __Dir() list all files that match the mask with the following details: Name, Extension, Size, Date.

DIR command is preprocessed into __Dir() function during compile time.

__Dir() is a compatibility function, it is superseded by Directory() which return all the information in a multidimensional array.

Examples

      __Dir()      // information for all DBF files in current directory

      __Dir( "*.dbf" )         // list all DBF file in current directory

      // list all PRG files in Harbour Run-Time library
      // for MS-DOS compatible operating systems
      __Dir( "src\rtl\*.prg" )

      // list all files in the public section on a Unix like machine
      __Dir( "/pub" )

Compliance

Clipper

Platforms

All(LFN)

Files

Library is core

Seealso

ADir(), Directory(), SET DEFAULT, DIR

C5_Functions

 AADD()          Add a new element to the end of an array
 ABS()           Return the absolute value of a numeric expression
 ACHOICE()       Execute a pop-up menu
 ACLONE()        Duplicate a nested or multidimensional array
 ACOPY()         Copy elements from one array to another
 ADEL()          Delete an array element
 ADIR()*         Fill a series of arrays with directory information
 AEVAL()         Execute a code block for each element in an array
 AFIELDS()*      Fill arrays with the structure of the current database file
 AFILL()         Fill an array with a specified value
 AINS()          Insert a NIL element into an array
 ALERT()         Display a simple modal dialog box
 ALIAS()         Return a specified work area alias
 ALLTRIM()       Remove leading and trailing spaces from a character string
 ALTD()          Invoke the CA-Clipper debugger
 ARRAY()         Create an uninitialized array of specified length
 ASC()           Convert a character to its ASCII value
 ASCAN()         Scan an array for a value or until a block returns true (.T.)
 ASIZE()         Grow or shrink an array
 ASORT()         Sort an array
 AT()            Return the position of a substring within a character string
 ATAIL()         Return the highest numbered element of an array
 BIN2I()         Convert a 16-bit signed integer to a numeric value
 BIN2L()         Convert a 32-bit signed integer to a numeric value
 BIN2W()         Convert a 16-bit unsigned integer to a numeric value
 BOF()           Determine when beginning of file is encountered
 BREAK()         Branch out of a BEGIN SEQUENCE...END construct
 BROWSE()*       Browse records within a window
 CDOW()          Convert a date value to a character day of the week
 CHR()           Convert an ASCII code to a character value
 CMONTH()        Convert a date to a character month name
 COL()           Return the screen cursor column position
 COLORSELECT()   Activate attribute in current color settings
 CTOD()          Convert a date string to a date value
 CURDIR()        Return the current DOS directory
 DATE()          Return the system date as a date value
 DAY()           Return the day of the month as a numeric value
 DBAPPEND()      Append a new record to the database in the current work area
 DBCLEARFIL()    Clear a filter condition
 DBCLEARIND()    Close all indexes for the current work area
 DBCLEARREL()    Clear active relations
 DBCLOSEALL()    Close all occupied work areas
 DBCLOSEAREA()   Close a work area
 DBCOMMIT()      Flush pending updates
 DBCOMMITALL()   Flush pending updates in all work areas
 DBCREATE()      Create a database file from a database structure array
 DBCREATEIND()   Create an index file
 DBDELETE()      Mark a record for deletion
 DBEDIT()        Browse records in a table layout
 DBEVAL()        Evaluate code block for each record matching scope/condition
 DBF()*          Return current alias name
 DBFIELDINFO()   Return and optionally change information about a field
 DBFILEGET()     Insert the contents of a field into a file
 DBFILEPUT()     Insert the contents of a file into a field
 DBFILTER()      Return the current filter expression as a character string
 DBGOBOTTOM()    Move to the last logical record
 DBGOTO()        Position record pointer to a specific identity
 DBGOTOP()       Move to the first logical record
 DBINFO()        Return and optionally change database file information
 DBORDERINFO()   Return and optionally change order and index file information
 DBRECALL()      Reinstate a record marked for deletion
 DBRECORDINFO()  Return and optionally change information about a record
 DBREINDEX()     Recreate all active indexes for the current work area
 DBRELATION()    Return the linking expression of a specified relation
 DBRLOCK()       Lock the record at the current or specified identity
 DBRLOCKLIST()   Return an array of the current lock list
 DBRSELECT()     Return the target work area number of a relation
 DBRUNLOCK()     Release all or specified record locks
 DBSEEK()        Move to the record having the specified key value
 DBSELECTAR()    Change the current work area
 DBSETDRIVER()   Return the database driver and optionally set a new driver
 DBSETFILTER()   Set a filter condition
 DBSETINDEX()    Empty orders from an order bag into the order list
 DBSETORDER()    Set the controlling order
 DBSETRELAT()    Relate two work areas
 DBSKIP()        Move relative to the current record
 DBSTRUCT()      Create an array containing the structure of a database file
 DBUNLOCK()      Release all locks for the current work area
 DBUNLOCKALL()   Release all locks for all work areas
 DBUSEAREA()     Use a database file in a work area
 DELETED()       Return the deleted status of the current record
 DESCEND()       Create a descending index key value
 DEVOUT()        Write a value to the current device
 DEVOUTPICT()    Write a value to the current device using a picture clause
 DEVPOS()        Move the cursor or printhead to a new position
 DIRCHANGE()     Change the current DOS directory
 DIRECTORY()     Create an array of directory and file information
 DIRMAKE()       Create a directory
 DIRREMOVE()     Remove a directory
 DISKCHANGE()    Change the current DOS disk drive
 DISKNAME()      Return the current DOS drive
 DISKSPACE()     Return the space available on a specified disk
 DISPBEGIN()     Begin buffering screen output
 DISPBOX()       Display a box on the screen
 DISPCOUNT()     Return the number of pending DISPEND() requests
 DISPEND()       Display buffered screen updates
 DISPOUT()       Write a value to the display
 DOSERROR()      Return the last DOS error number
 DOW()           Convert a date value to a numeric day of the week
 DTOC()          Convert a date value to a character string
 DTOS()          Convert a date value to a string formatted as yyyymmdd
 EMPTY()         Determine if the result of an expression is empty
 EOF()           Determine when end of file is encountered
 ERRORBLOCK()    Post a code block to execute when a runtime error occurs
 ERRORLEVEL()    Set the CA-Clipper return code
 EVAL()          Evaluate a code block
 EXP()           Calculate e**x
 FCLOSE()        Close an open binary file and write DOS buffers to disk
 FCOUNT()        Return the number of fields in the current .dbf file
 FCREATE()       Create and/or truncate a binary file to zero-length
 FERASE()        Delete a file from disk
 FERROR()        Test for errors after a binary file operation
 FIELD()         Return a field name from the current database (.dbf) file
 FIELDBLOCK()    Return a set-get code block for a given field
 FIELDGET()      Retrieve the value of a field using the field position
 FIELDNAME()     Return a field name from the current database (.dbf) file
 FIELDPOS()      Return the position of a field in a work area
 FIELDPUT()      Set the value of a field variable using the field position
 FIELDWBLOCK()   Return a set-get code block for a field in a given work area
 FILE()          Determine if files exist in the default directory or path
 FKLABEL()*      Return function key name
 FKMAX()*        Return number of function keys as a constant
 FLOCK()         Lock an open and shared database file
 FOPEN()         Open a binary file
 FOUND()         Determine if the previous search operation succeeded
 FREAD()         Read characters from a binary file into a buffer variable
 FREADSTR()      Read characters from a binary file
 FRENAME()       Change the name of a file
 FSEEK()         Set a binary file pointer to a new position
 FWRITE()        Write to an open binary file
 GETACTIVE()     Return the currently active Get object
 GETAPPLYKEY()   Apply a key to a Get object from within a reader
 GETDOSETKEY()   Process SET KEY during GET editing
 GETENV()        Retrieve the contents of a DOS environment variable
 GETPOSTVALID()  Postvalidate the current Get object
 GETPREVALID()   Prevalidate a Get object
 GETREADER()     Execute standard READ behavior for a Get object
 HARDCR()        Replace all soft carriage returns with hard carriage returns
 HEADER()        Return the current database file header length
 I2BIN()         Convert a CA-Clipper numeric to a 16-bit binary integer
 IF()            Return the result of an expression based on a condition
 IIF()           Return the result of an expression based on a condition
 INDEXEXT()      Return index extension defined by the current database driver
 INDEXKEY()      Return the key expression of a specified index
 INDEXORD()      Return the order position of the controlling index
 INKEY()         Extract a character from the keyboard buffer or a mouse event
 INT()           Convert a numeric value to an integer
 ISALPHA()       Determine if the leftmost character in a string is alphabetic
 ISCOLOR()       Determine if the current computer has color capability
 ISDIGIT()       Determine if the leftmost character in a string is a digit
 ISLOWER()       Determine if the leftmost character is a lowercase letter
 ISPRINTER()     Determine whether LPT1 is ready
 ISUPPER()       Determine if the leftmost character in a string is uppercase
 L2BIN()         Convert a CA-Clipper numeric value to a 32-bit binary integer
 LASTKEY()       Return INKEY() value of last key extracted from the keyboard
 LASTREC()       Determine the number of records in the current .dbf file
 LEFT()          Extract substring beginning with first character in a string
 LEN()           Return the length of a string or number of array elements
 LOG()           Calculate the natural logarithm of a numeric value
 LOWER()         Convert uppercase characters to lowercase
 LTRIM()         Remove leading spaces from a character string
 LUPDATE()       Return the last modification date of a database (.dbf) file
 MAX()           Return the larger of two numeric or date values
 MAXCOL()        Determine the maximum visible screen column
 MAXROW()        Determine the maximum visible screen row
 MEMOEDIT()      Display or edit character strings and memo fields
 MEMOLINE()      Extract a line of text from a character string or memo field
 MEMOREAD()      Return the contents of a disk file as a character string
 MEMORY()        Determine the amount of available free pool memory
 MEMOSETSUPER()  Set an RDD inheritance chain for the DBFMEMO database driver
 MEMOTRAN()      Replace carriage return/linefeeds in character strings
 MEMOWRIT()      Write a character string or memo field to a disk file
 MEMVARBLOCK()   Return a set-get code block for a given memory variable
 MENUMODAL()     Activate a top bar menu
 MIN()           Return the smaller of two numeric or date values
 MLCOUNT()       Count the number of lines in a character string or memo field
 MLCTOPOS()      Return position of a string based on line and column position
 MLPOS()         Determine the position of a line in a string or memo field 
 MOD()*          Return the dBASE III PLUS modulus of two numbers
 MONTH()         Convert a date value to the number of the month
 MPOSTOLC()      Return line/ column position of a string based on a position
 NETERR()        Determine if a network command has failed
 NETNAME()       Return the current workstation identification
 NEXTKEY()       Read the pending key in the keyboard buffer 
 NOSNOW()        Toggle snow suppression
 ORDBAGEXT()     Return the default order bag RDD extension
 ORDBAGNAME()    Return the order bag name of a specific order
 ORDCOND()       Specify conditions for ordering
 ORDCONDSET()    Set the condition and scope for an order
 ORDCREATE()     Create an order in an order bag
 ORDDESCEND()    Return and optionally change the descending flag of an order
 ORDDESTROY()    Remove a specified order from an order bag
 ORDFOR()        Return the FOR expression of an order
 ORDISUNIQUE()   Return the status of the unique flag for a given order
 ORDKEY()        Return the key expression of an order
 ORDKEYADD()     Add a key to a custom built order
 ORDKEYCOUNT()   Return the number of keys in an order
 ORDKEYDEL()     Delete a key from a custom built order
 ORDKEYGOTO()    Move to a record specified by its logical record number
 ORDKEYNO()      Get the logical record number of the current record
 ORDKEYVAL()     Get key value of the current record from controlling order
 ORDLISTADD()    Add orders to the order list
 ORDLISTCLEAR()  Clear the current order list
 ORDLISTREBUI()  Rebuild all orders in the order list of the current work area
 ORDNAME()       Return the name of an order in the order list
 ORDNUMBER()     Return the position of an order in the current order list
 ORDSCOPE()      Set or clear the boundaries for scoping key values
 ORDSETFOCUS()   Set focus to an order in an order list
 ORDSETRELAT()   Relate a specified work area to the current work area
 ORDSKIPUNIQUE() Move record pointer to the next or previous unique key
 OS()            Return the operating system name
 OUTERR()        Write a list of values to the standard error device
 OUTSTD()        Write a list of values to the standard output device
 PAD()           Pad character, date, and numeric values with a fill character
 PCOL()          Return the current column position of the printhead
 PCOUNT()        Determine the position of the last actual parameter passed
 PROCLINE()      Return source line number of current or previous activation
 PROCNAME()      Return name of the current or previous procedure or function
 PROW()          Return the current row position of the printhead
 QOUT()          Display a list of expressions to the console
 RAT()           Return the position of the last occurrence of a substring
 RDDLIST()       Return an array of the RDDs
 RDDNAME()       Return name of RDD active in current or specified work area
 RDDSETDEFAULT() Set or return the default RDD for the application
 READEXIT()      Toggle Up arrow and Down arrow as READ exit keys
 READFORMAT()    Return and optionally set code block to implement format file
 READINSERT()    Toggle the current insert mode for READ and MEMOEDIT()
 READKEY()*      Determine what key terminated a READ
 READKILL()      Return and optionally set whether current READ can be exited
 READMODAL()     Activate a full-screen editing mode for a GetList
 READUPDATED()   Determine whether any GET variables changed during a READ
 READVAR()       Return the current GET/MENU variable name
 RECCOUNT()*     Determine the number of records in the current database file
 RECNO()         Return the identity at the position of the record pointer
 RECSIZE()       Determine the record length of a database (.dbf) file
 REPLICATE()     Return a string repeated a specified number of times
 RESTSCREEN()    Display a saved screen region to a specified location
 RIGHT()         Return a substring beginning with the rightmost character
 RLOCK()         Lock the current record in the active work area
 ROUND()         Return a numeric value rounded to a specified number of digits
 ROW()           Return the screen row position of the cursor
 RTRIM()         Remove trailing spaces from a character string
 SAVESCREEN()    Save a screen region for later display
 SCROLL()        Scroll a screen region up or down, right or left
 SECONDS()       Return the number of seconds elapsed since midnight
 SELECT()        Determine the work area number of a specified alias
 SET()           Inspect or change a system setting
 SETBLINK()      Toggle * interpretation between blinking/background intensity
 SETCANCEL()     Toggle Alt+C and Ctrl+Break as program termination keys
 SETCOLOR()      Return the current colors and optionally set new colors
 SETCURSOR()     Set the cursor shape
 SETKEY()        Assign an action block to a key
 SETMODE()       Change display mode to a specified number of rows and columns
 SETPOS()        Move the cursor to a new position
 SETPRC()        Set PROW() and PCOL() values
 SOUNDEX()       Convert a character string to "soundex" form
 SPACE()         Return a string of spaces
 SQRT()          Return the square root of a positive number
 STR()           Convert a numeric expression to a character string
 STRTRAN()       Search and replace characters within a string or memo field
 STUFF()         Delete and insert characters in a string
 SUBSTR()        Extract a substring from a character string
 TIME()          Return the system time
 TONE()          Sound a speaker tone for a specified frequency and duration
 TRANSFORM()     Convert any value into a formatted character string
 TRIM()          Remove trailing spaces from a character string
 TYPE()          Determine the type of an expression
 UPDATED()       Determine whether a GET changed during a READ
 UPPER()         Convert lowercase characters to uppercase
 USED()          Determine whether a database file is in USE
 VAL()           Convert a character number to numeric type
 VALTYPE()       Determine the data type returned by an expression
 VERSION()       Returns CA-Clipper version
 WORD()*         Convert CALL command numeric parameters from double to int
 YEAR()          Convert a date value to the year as a numeric value

C5_ADIR

 ADIR()*
 Fill a series of arrays with directory information
------------------------------------------------------------------------------
 Syntax

     ADIR([<cFilespec>],
        [<aFilenames>],
        [<aSizes>],
        [<aDates>],
        [<aTimes>],
        [<aAttributes>]) --> nFiles

 Arguments

     <cFilespec> is the path specification of files to include in the
     scan of the DEFAULT directory.  It is a standard file specification that
     can include the wildcard characters * and ?, as well as a drive and path
     reference.  If omitted, the default specification is *.*.

     <aFilenames> is the array to fill with the file names matching
     <cFilespec>.  Each element contains the file name and extension as a
     character string in all uppercase letters.

     <aSizes> is the array to fill with the sizes of the corresponding
     files in the <aFilenames> array.  Each element is a numeric data type.

     <aDates> is the array to fill with the dates of the corresponding
     files in the <aFilenames> array.  Each element is a date data type.

     <aTimes> is the array to fill with the times of the corresponding
     files in the <aFilenames> array.  Each element filled contains a
     character string of the form: hh:mm:ss.

     <aAttributes> is the array to fill with attributes of the
     corresponding files in the <aFilenames> array.  Each element is a
     character string.  If <aAttributes> is specified, hidden, system, and
     directory files are included as well as normal files.  If <aAttributes>
     is not specified, only normal files are included.

 Returns

     ADIR() returns the number of files matching the directory skeleton
     described in <cFilespec>.

 Description

     ADIR() is an array function that performs two basic operations.  First,
     it returns the number of files matching the file specification.  Second,
     it fills a series of arrays with file names, sizes, dates, times, and
     attributes.

     ADIR() is a compatibility function and therefore not recommended.  It is
     superseded by the DIRECTORY() function which returns all file
     information in a multidimensional array.

 Notes

     .  Directories:  If you specify the <aAttributes> argument and
        <cFilespec> is *.*, directories will be included in <aFilenames>.  In
        the <aAttributes> array, directories are indicated with an attribute
        value of "D".  If ADIR() is executed within a subdirectory, the first
        two entries of the <aFilenames> array are "." and "..", the parent
        and current directory aliases.  The date and time of last update are
        reported for directories, but the size of a directory is always zero.

 Examples

     .  This example creates an array to hold the names of all .txt
        files in the current DEFAULT directory, then uses AEVAL() to list
        them to the console:

        LOCAL aFiles[ADIR("*.TXT")]
        ADIR("*.TXT", aFiles)
        AEVAL(aFiles, { |element| QOUT(element) })

 Files   Library is EXTEND.LIB.

See Also: ACHOICE() AEVAL() ASCAN() ASORT() DIRECTORY()