__Dir()

Template

Function

Name

__Dir()*

Category

API

Subcategory

FileSys

Oneliner

Display listings of files

Syntax

      __Dir( [<cFileMask>] ) --> NIL

Arguments

<cFileMask> File mask to include in the function return. It could contain path and standard wildcard characters as supported by your OS (like * and ?). If <cFileMask> contains no path, then SET  DEFAULT path is used to display files in the mask.

Returns

__Dir() always returns NIL.

Description

If no <cFileMask> is given, __Dir() displays information about all *.dbf in the SET DEFAULT path. This information contains: file name, number of records, last update date and the size of each file.

If <cFileMask> is given, __Dir() list all files that match the mask with the following details: Name, Extension, Size, Date.

DIR command is preprocessed into __Dir() function during compile time.

__Dir() is a compatibility function, it is superseded by Directory() which return all the information in a multidimensional array.

Examples

      __Dir()      // information for all DBF files in current directory

      __Dir( "*.dbf" )         // list all DBF file in current directory

      // list all PRG files in Harbour Run-Time library
      // for MS-DOS compatible operating systems
      __Dir( "src\rtl\*.prg" )

      // list all files in the public section on a Unix like machine
      __Dir( "/pub" )

Compliance

Clipper

Platforms

All(LFN)

Files

Library is core

Seealso

ADir(), Directory(), SET DEFAULT, DIR

4 responses to “__Dir()

  1. Pingback: Harbour All Functions – C | Viva Clipper !

  2. Pingback: Harbour Internal Functions | Viva Clipper !

  3. Pingback: Harbour Files and Folders Functions | Viva Clipper !

  4. Pingback: Harbour RG Summary | Viva Clipper !

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.