11 /read_only – Compaq DEC Text Processing Utility AA-PWCBD-TE User Manual
Page 37
Getting Started with DECTPU
2.6 Using OpenVMS EDIT/TPU Command Qualifiers
Using /NOOUTPUT, you can develop an application that lets you control the
output of a file. For example, an application could be coded so that if you specify
/NOOUTPUT on the DCL command line, DECTPU would set the NO_WRITE
attribute for the main buffer and suppress creation of an output file for that
buffer.
2.6.11 /READ_ONLY
/READ_ONLY
/NOREAD_ONLY (default)
The /READ_ONLY qualifier determines whether the application layered on
DECTPU creates an output file from the contents of the main buffer if the
contents are modified.
The processing of the /READ_ONLY qualifier is interrelated with the processing
of the /WRITE qualifier. /READ_ONLY is equivalent to /NOWRITE; /NOREAD_
ONLY is equivalent to /WRITE.
DECTPU signals an error and returns control to DCL if DECTPU encounters
either of the following combinations of qualifiers on the DCL command line:
•
/READ_ONLY and /WRITE
•
/NOREAD_ONLY and /NO_WRITE
The application layered on DECTPU is responsible for processing this qualifier.
To determine whether either the /READ_ONLY or /NOWRITE qualifier was used
on the DCL command line, use the following call in an application:
x := GET_INFO (COMMAND_LINE, "read_only");
This statement returns 1 if /READ_ONLY or /NOWRITE was explicitly specified
on the command line.
To determine whether either /NOREAD_ONLY or /WRITE was used on the DCL
command line, use the following call in an application:
x := GET_INFO (COMMAND_LINE, "write");
This statement returns 1 if /NOREAD_ONLY or /WRITE was explicitly specified
on the command line.
If both GET_INFO calls return false, the application is expected to determine
the default behavior. For more information on GET_INFO, see the DEC Text
Processing Utility Reference Manual.
In EVE, using the /READ_ONLY qualifier is equivalent to using the
/NOJOURNAL, /NOMODIFY, and /NOOUTPUT qualifiers. If you specify /READ_
ONLY, DECTPU does not maintain a journal file for your editing session, and
the NO_WRITE and NO_MODIFY attributes are set for the main buffer. When
a buffer is set to NO_WRITE, the contents of the buffer are not written out upon
exit, regardless of whether the session is terminated with the EXIT built-in or the
QUIT built-in. For example, if you want to edit a file called MEETING.MEM but
not write out the contents when exiting or quitting, use the following command:
$ EDIT/TPU/READ_ONLY meeting.mem
In response to the /NOREAD_ONLY qualifier, EVE writes out the buffer specified
on the command line (if the buffer has been modified) when an EXIT command is
issued. This is the default behavior.
Getting Started with DECTPU 2–17