ADIR()

From Lianjapedia
Jump to: navigation, search

Purpose

Function to return number of files and/or directories matching a file pattern and load file information into an array

Syntax

ADIR(<array> [, <skeleton> [, <expC> [, <expN>]]])

See Also

AADD(), AAVERAGE(), ACOPY(), ADEL(), ADESC(), AELEMENT(), AFIELDS(), AFILES(), AFILL(), AINS(), ALEN(), AMAX(), AMIN(), APPEND FROM ARRAY, ARRAY(), ASCAN(), ASIZE(), ASORT(), ASTORE(), ASTRING(), ASUBSCRIPT(), ASUM(), COPY TO ARRAY, DECLARE, DIMENSION, DIR, FDATE(), FILE(), GATHER, IN_ARRAY(), IS_ARRAY(), LOCAL, PRIVATE, PUBLIC, RELEASE, RESTORE, SAVE, SCATTER, SYSFILES

Description

The ADIR() function returns the number of files and/or directories which match the specified file skeleton and loads file information into the array <array>. The following 'wild card' characters can be used in the <skeleton>:

Character Description
? Matches any one character.
* Matches zero or more characters.

If ADIR() returns a value greater than 0, the <array> will be created if it does not exist and resized if previously in existence. The ADIR() function will load the following information about the files/directories into the array:

Column Type Contents
1 Character Name
2 Numeric Size
3 Date Last modification date
4 Character Last modification time
5 Character Attributes

The attributes filter in <expC> can be any of the following:

Letter Attribute
A Archive (Read/Write)
H Hidden
R Read only
S System
D Directory

The flags <expN> parameter is determines the case of the file names returned. Note: on Linux/Mac this is parsed, but ignored. The file names are always returned in their original case.

Flag Case
Upper
0 Upper
1 Original

Example

nTables = adir(aTables, "*.dbf")