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

OPEN^%ZISH(): Open Host File

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

Description

This API opens a Host file without using the device handler. You can USE the device name returned in IO. You can then READ and WRITE from the opened Host file (depending on what access mode you used to open the file).

To close the Host file, use the CLOSE^%ZISH API with the handle you used to open the file.

Format

  OPEN^%ZISH([handle][,path,]filename,mode[,max][,subtype])

Input Parameters

handle:

(optional) Unique name you supply to identify the opened device.

path:

(optional) Full path, up to but not including the filename. If not supplied, the default HFS directory will be used.

filename:

(required) Name of the file to open.

mode:

(required) Mode to open file:

  • W—WRITE

  • R—READ

  • A—APPEND

  • B—BLOCK (fixed record size)
max:

(optional) Maximum record size for a new file.

subtype:

(optional) File subtype.

Output Variables

POP:

A value of zero (0) means the file was opened successfully; a positive value means the file was not opened.

IO:

Name of the opened file in the format to use for M USE and CLOSE commands.

Example

D OPEN^%ZISH("FILE1","USER$:[ANONYMOUS]","ARCHIVE.DAT","A")
Q:POP
U IO F I=1:1:100 W I,": ",ARRAY(I),!
D CLOSE^%ZISH("FILE1")

 


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

Reviewed/Updated: August 26, 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.