class Dir

This class provides a means for listing the files in a directory

class attributes [NB. Highlighted attributes are static members]
function Dir() - The constructor for a Dir object
function readdir() - Reads a file name from the directory stream
function toArray() - Creates an array from the list of files in this directory
function close() - You should call this function when you have finished reading

Functions

function Dir Click to go up to the list
The constructor for a Dir object
Declaration:
    native function Dir(string directory)
Description:
This function is the constructor for the Sys.Dir class. You should supply it with the name of the directory you wish to read the file names from. You may then either call the toArray() method to generate an array of filenames in one step or repeatedly call the readdir() to read the file names one at a time. To "rewind" to the beginning or to read another directory without creating a new Dir object, call constructor again and the directory stream will be closed and reopened.
Parameters:
    Parameter #1: string directory - The path to the directory to read from

function readdir Click to go up to the list
Reads a file name from the directory stream
Declaration:
    native function readdir()
Description:
This function reads the next file name from this directory stream object and returns it as a string. On error, an empty string is returned and err.number is set to the system error number (which is always greater than 0). When there are no more files left to read, an empty string is returned and err.number is set to 0.

function toArray Click to go up to the list
Creates an array from the list of files in this directory
Declaration:
    function toArray()
Description:
This function returns an array of strings containing the names of the files in the directory this Dir object points to. You should either call this function or repeatedly call the readdir() function, not both. You can only call toArray() once unless you call the constructor again to reopen the directory stream.

function close Click to go up to the list
You should call this function when you have finished reading
Declaration:
    function close()

Automatically generated at 8:45pm, Wednesday 08 January 2003 by feritedoc.