Kernel 8.0 APIs Banner [skip navigation]
Office of Information & Technology (OIT) Banner

$$LIST^%ZISH(): List Directory

Reference Type: Supported, Category: Host Files, Integration Agreement: 2320

Description

This extrinsic function returns a list of file names in the current directory. The list is returned in an array in the variable named by the third parameter.

Format

  $$LIST^%ZISH(path,arrname,retarrnam)

Input Parameters

path:

(required) Full path, up to but not including any filename. For current directory, pass the NULL string.

arrname:

(required) Fully resolved array name containing file specifications to list at the next descendent subscript level.

For example, to list all files, set one node in the named array, at subscript "*", equal to NULL. To list all files beginning with "E" and "L", using the ARRAY array, set the nodes:

  ARRAY("E*")=""

  ARRAY("L*")=""

Pass the name "ARRAY" as the arrname parameter. You can use the asterisk wildcard in the file specification.

retarrnam:

(required) Fully resolved array name to return the list of matching filenames. You should ordinarily KILL this array first (it is not purged by LIST^%ZISH).

Output Parameters

retarrnam:

$$LIST^%ZISH populates the array named in the third input parameter with all matching files it finds in the directory you specify. It populates the array in the format:

  ARRAY("filename1")=""

  ARRAY("filename2")=""

  (etc.)

Output

returns:

Returns:

  • 1—Success.

  • 0—Failure.

Example

>K FILESPEC,FILE
>S FILESPEC("L*")="",FILESPEC("P*")=""
>S Y=$$LIST^%ZISH("","FILESPEC","FILE")

 


VA (Internet) / VA(Intranet) / OI / PD / Site Map / Terms of Use / VA Privacy Policy / Accessibility

Reviewed/Updated: September 15, 2011

If you have questions, need more information, or are having accessibility problems with this website, please contact us by E-Mail: Webmasters, Phone: 510-768-6800, or FAX: 510-768-6850.