ReadDiskDirectory (open)

Read the contents of a directory on disk

Syntax

LOADLIB "wh::files.whlib";

RECORD ARRAY FUNCTION ReadDiskDirectory(STRING directory, STRING mask)

Parameters

STRING directory

Path to directory to read.

STRING mask

Mask of files to read (* to read all files)

Return value

RECORD ARRAY

A record array of found files and directories

DATETIME modified

Last modification time, in UTC

STRING name

Name of the directory entry

STRING path

Full path to the directory entry

INTEGER size

Size of the file, in bytes

INTEGER64 size64

Size of the file, in bytes

INTEGER type

Type of the directory entry (0=file, 1=directory, 2=link)

INTEGER unixpermissions

Unix file permissions.

Description

Reads a directory, optionally filtering the contents with a mask. The UNIX globbing rules will apply when using this mask (eg, "." only matches files with an extension, not all files as it would do on DOS/NT). This function never returns the "." and ".." directory entries.