11.07.2015 Views

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - InterSystems Documentation

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

System and Other FunctionsDescriptionThis $ZUTIL(68,3) function specifies if a sequential file is created automatically in responseto an OPEN command that specifies a file that does not already exist. In <strong>Caché</strong>, if you attemptto open a file in "W" or "RW" mode, but that file does not yet exist, the default behavior isplatform-dependent. On Windows and UNIX systems, the default is for <strong>Caché</strong> to hang untilthe file is actually created, or until the process is resolved by a timeout expiration or by callingthe RESJOB utility. On OpenVMS systems, the default is to create a new sequential file.This system-wide default behavior can be configured using the $ZUTIL(69,3) function. See$ZUTIL(69,3) — Automatic File Creation Mode System Default.Setting $ZUTIL(68,3) causes <strong>Caché</strong> to create a sequential file automatically when you issuethe OPEN command in "W" or "RW" mode for a file that does not already exist. This$ZUTIL(68,3) setting governs all sequential file opens in the current process.The system-wide or current-process default behavior can be overridden for individual OPENcommands using the “E” (or /CREATE) mode parameter. The OPEN mode parameters arelisted in Sequential File I/O in the <strong>Caché</strong> I/O Device Guide.Invoking $ZUTIL(68,3) without specifying n returns the current switch setting.ParametersnThe switch that specifies whether or not a file is created when the process attempts to opena nonexistent file. 0 specifies that automatic new file creation is disabled. 1 specifies thatautomatic new file creation is enabled. The system default setting is 0.ExampleSET x=$ZUTIL(69,3),y=$ZUTIL(68,3)WRITE !,"system-wide auto-create on open:",xWRITE !,"current process auto-create on open:",yIF y=0 {SET z=$ZUTIL(68,3,1)WRITE !,"Set the process auto-create option to:",$ZUTIL(68,3)}ELSE {WRITE !,"Auto-create on open was already set to:",$ZUTIL(68,3)}OPEN "c:\myfiles\seqtest2":("RW"):5; ...QUITSee Also• $ZUTIL(69,3)— Automatic File Creation Mode System Default function602 <strong>Caché</strong> <strong>ObjectScript</strong> <strong>Reference</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!