Skip to content

Directory Command

Obsolete

This command is obsolete. It is valid only in character-mode DataFlex. In DataFlex, you can use the dir: driver of the Direct Input command to read the contents of a folder.

Purpose

To display a directory of disk files to the screen.

Syntax

directory
file_spec

Argument Explanation

file_spec may be of any class but must be of type String. It may contain ambiguous filenames (including * and ?), or it may identify a logical disk drive and/or subdirectory path without any filename.

What It Does

The directory command displays to the screen a directory of the disk files specified in file_spec. If a null file_spec (" ") is given, directory outputs the names of all files on the current drive and directory.

directory "b:"

This example would display the names of all files on the b: logical disk drive. The drive is identified literally, in quotation marks.

directory "\ops\*.rpt"

This example, using a literal file specification in quotation marks, would display the names of all files whose extensions were rpt in the \ops directory.

directory screen.5

This example would display the names of the file(s) specified by the filename and/or drive and/or directory whose name was in the contents of the fifth window in ImageScreen.

directory trucks

This example would display the names of the file(s) specified by the filename and/or drive and/or directory whose name was in the contents of the variable trucks.

Notes

  • You do not need to open files to use directory.
  • In applications that may be run in various operating systems, literal file_specs should be avoided in favor of variable file_specs. This is because the syntax of directories and filenames varies from environment to environment, and variable file_specs can be specified in a separate installation program specifically for the target environment.