SED navigation bar go to SED home page go to Dataplot home page go to NIST home page SED Home Page SED Staff SED Projects SED Products and Publications Search SED Pages
Dataplot Vol 1 Vol 2

DIR

Name:
    DIR
Type:
    Support Command
Purpose:
    This command lists the contents of a file.
Description:
    This command uses an operating system command to list the contents a directory.

    For Unix/Linux/MacOS systems, the DIR command issues a

      ls ....

    command to the operating system.

    For Windows systems, the DIR command issues a

      DIR ....

    command to the operating system.

    The string that follows the DIR on the command line is passed to the operating system as is. Dataplot does no error checking of this string.

    This is a system dependent command. It is currently supported for Unix/Linux/MacOS and Windows platforms.

Syntax:
    DIR <file-list>
    where <file-list> is an optional string specifying what files should be listed.

    If <file-list> is omitted, then the contents of the current directory are listed.

Examples:
    DIR
    DIR macros/*.dp
    DIR macros
Note:
    The DIR capability can be implemented by direct use of the SYSTEM command. For example, under Linux do something like

      SYSTEM ls *.dp

    The motivation for adding this as a separate command is to allow the capability to be implemented in an operating system independent way. This can be useful when writing general purpose macros that may be used on different operating systems.

Note:
    Both the Linux ls command and the Windows DIR commands support a number of different options for displaying the output. A few of these are supported as follows.

    If you would like to display the results one screen at a time, enter the command

      SET DIR PAUSE ON

    This adds a "/P" option under Windows. For Linux, the output will be piped to the Linux more command. To reset the default (no pause), enter the command

      SET DIR PAUSE OFF

    If you would like the contents of any listed directories to be displayed, enter the command

      SET DIR RECURSIVE ON

    This adds a "/S" option under Windows and a "-R" option under Linux. To reset the default (no recursive listing of directory contents), enter the command

      SET DIR RECURSIVE OFF

    To specify "long listing" (i.e., more detailed information about each file), enter the command

      SET DIR LONG LISTING ON

    This adds a "/N" option under Windows and a "-l" option under Linux. To reset the default ("/W" option under Windows and no "-l" option under Linux), enter the command

      SET DIR LONG LISTING OFF

    By default, files are listed alphabetically. To specify sorting by size, enter the command

      SET DIR SORT SIZE

    This adds a "/O:S" option under Windows and a "-s" option under Linux.

    To specify sorting by date, enter the command

      SET DIR SORT DATE

    This adds a "/O:D" option under Windows and a "-t" option under Linux.

    To reset alphabetic sorting, enter the command

      SET DIR SORT ALPHABETIC

    This adds a "/O:N" option under Windows. No option is given for Linux.

    If you want to use options not supported by one of the above SET commands, you can enter them manually. For example, under Linux you can do something like

      DIR -aFC *
Note:
    File names are case sensitive on Unix/Linux/MacOS file systems. For this reason, case is preserved in passing the file name to the operating system.
Default:
    None
Synonyms:
    LS is a synonym for DIR
Related Commands:
    SYSTEM = Enter an operating system command within a Dataplot session.
    CD = Change the current working directory.
    PWD = Retrieve the current working directory.
    MKDIR = Create a new directory
    RM = Delete one or more files.
    CAT = List the contents of a file.
Applications:
    Interactive Usage
Implementation Date:
    2019/09
Program:
     
    SKIP 25
    READ BERGER1.DAT Y X
    .
    CAPTURE FIT.OUT
    FIT Y X
    END OF CAPTURE
    .
    DIR *.OUT  FIT.*
     
        

Privacy Policy/Security Notice
Disclaimer | FOIA

NIST is an agency of the U.S. Commerce Department.

Date created: 09/13/2019
Last updated: 09/13/2019

Please email comments on this WWW page to alan.heckert@nist.gov.