DIR or DIRECTORY Command
Displays information about the files in a directory.
DIR | DIRECTORY [ON Drive] [[LIKE] [Path] [FileSkeleton]] [TO PRINTER [PROMPT] | TO FILE FileName] |
Parameters
- ON Drive
-
Specifies the name of the drive on which the directory is located.
- [[LIKE] [Path] [FileSkeleton]]
-
Specifies the path to the directory containing the files. The path can include the drive name if you omit ON Drive.
Include FileSkeleton to display information about file types other than tables. FileSkeleton is a file specification skeleton that supports wildcards. For example, to list all program files in the current directory, issue the following command:
Copy CodeDIR *.PRG
In Visual FoxPro, you can issue the following command to list all files without extensions:
Copy CodeDIR *.
- TO PRINTER [PROMPT]
-
Directs output from DIRECTORY to a printer.
In Microsoft Visual FoxPro, you can include the optional PROMPT clause to display a print dialog box before printing starts. In this dialog box you can adjust printer settings, including the number of copies and page numbers to print. The printer settings that you can adjust depend on the currently installed printer driver. Place the PROMPT keyword immediately after TO PRINTER.
- TO FILE FileName
-
Directs output from DIRECTORY to the file specified with FileName. If the file already exists and SET SAFETY is ON, you are asked if you want to overwrite the file.
Remarks
Example
See Also
© , 1996-2020 • Updated: 11/10/20
Comment or report problem with topic
Microsoft Visual FoxPro 9 SP2 Help file, VFPX Edition v1.08