nFiles ADIR([<cFilespec>],[<aFilenames>],[<aSizes>],[<aDates>], [<aTimes>],[<aAttributes>]) cDirectory CURDIR([<cDrivespec>]) nSuccess DIRCHANGE(<cDir>) nSuccess DIRMAKE(<cNewDir>) nSuccess DIRREMOVE(<cDirName>) lSuccess DISKCHANGE(<cDrive>) cDrive DISKNAME() nBytes DISKSPACE([<nDrive>]) <sDosFileName> DOSPATH(<sUnixFileName>) <sUnixPath> MAKEPATH(<sDosPath>) <sPath> STARTPATH()
ADIR([<cFilespec>],[<aFilenames>],[<aSizes>],[<aDates>], [<aTimes>],[<aAttributes>]) --> nFiles
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.
<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>. |
See also : | ACHOICE() AEVAL() ASCAN() ASORT() DIRECTORY() |
CURDIR([<cDrivespec>]) --> cDirectory
CURDIR() is an environment function that gives you the name of the current DOS directory, ignoring the SET DEFAULT and SET PATH settings.
<cDrivespec> | specifies the letter of the disk drive to query. If not specified, the default is the current DOS drive. |
Returns : | CURDIR() returns the current DOS directory of the drive specified by <cDrivespec> as a character string without either leading or trailing backslash (\) characters. If an error occurs, or the current directory of the specified drive is the root directory, CURDIR() returns a null string (""). |
See also : | FILE() |
DIRCHANGE(<cDir>) --> nSuccess
DIRCHANGE() changes the current DOS directory. This function may also be used to determine whether or not a directory exists.
<cDir> | is the name of the directory to change to, including the drive. |
Returns : | DIRCHANGE() returns 0 if successful; -1 if there is an argument error. Otherwise, DIRCHANGE() returns the DOS error code. |
See also : | CURDIR() DIRMAKE() DIRREMOVE() DISKCHANGE() |
DIRMAKE(<cNewDir>) --> nSuccess
DIRMAKE() creates a specified directory. Note that first you must have sufficient rights to create a directory. To create nested subdirectories, you must create each subdirectory separately, starting from the top-level directory that you want to create (see example below.)
<cNewDir> | is the name of the directory to be created, including an optional drive. If you do not specify a drive, the current one is used. |
Returns : | DIRMAKE() returns 0 if successful; -1 if there is an argument error. Otherwise, DIRMAKE() returns the DOS error code. |
See also : | DIRCHANGE() DIRREMOVE() |
DIRREMOVE(<cDirName>) --> nSuccess
DIRREMOVE() removes a specified directory. Note that you must first have sufficient rights to delete a directory. A directory must be empty in order to be deleted. Therefore, to delete a directory that contains subdirectories, you must first delete the subdirectories (see example below).
<cDirName> | is the name of the directory to erase, including an optional drive. If you do not specify a drive, the current one is used. |
Returns : | DIRREMOVE() returns 0 if successful; -1 if there is an argument error. Otherwise, DIRREMOVE returns the DOS error code. |
See also : | DIRCHANGE() DIRMAKE() |
DISKCHANGE(<cDrive>) --> lSuccess
<cDrive> | specifies the letter of the disk drive to change to. |
Returns : | DISKCHANGE() returns true (.T.) if successful; otherwise, it returns false (.F.). |
See also : | DIRCHANGE() DISKNAME() |
DISKNAME() --> cDrive
Returns : | DISKNAME() returns the letter of the current DOS drive, without a trailing colon. |
See also : | CURDIR() DISKCHANGE() |
DISKSPACE([<nDrive>]) --> nBytes
DISKSPACE() is an environment function that determines the number of available bytes remaining on the specified disk drive. It is useful when COPYing or SORTing to another drive to determine if there is enough space available before initiating the operation. You may also use DISKSPACE() with RECSIZE() and RECCOUNT() to create a procedure to back up database files.
DISKSPACE() ignores the SET DEFAULT drive setting.
<nDrive> | is the number of the drive to query, where one is drive A, two is B, three is C, etc. The default is the current DOS drive if |
<nDrive> | is omitted or specified as zero. |
Returns : | DISKSPACE() returns the number of bytes of empty space on the specified disk drive as an integer numeric value. |
See also : | LASTREC() LUPDATE() RECSIZE() |
DOSPATH(<sUnixFileName>) --> <sDosFileName>
DOSPATH() uses specified in CLIP function SET("C", ...) values and returns UNIX file name as DOS file name.
MAKEPATH(<sDosPath>) --> <sUnixPath>
MAKEPATH() converts string with path to file in DOS-style <sDosPath> to string with path in UNIX-style <sUnixPath>
<sDosPath> | String, is the path to file in DOS style. |
Returns : | Returns string <sUnixPath>, what equal the DOS-style path to file <sDosPath> |
See also : | FOPEN() |
STARTPATH() --> <sPath>
STARTPATH() returns the string <sPath> what contain full path and name of started program.
Returns : | Returns the string <sPath> what contain full path and name of started program. |
See also : | CURDIR() DIRCHANGE() |