vThe resolved SOURCE ®le speci®cations

vThe resolved TARGET speci®cation

The exit keyword accepts any executable ®le or command. The exit program must return an integer return value, zero meaning successful; it must also accept or ignore the additional Gather parameters added to the end of the invocation string.

When used in the context of the RULE clause, exit keywords must follow the TARGET keyword.

Using exit keywords: an example

In the following example, the ®rst EXITPRIOR statement relates to the DATA clause and speci®es a user backup exit program, which executes before performing Gather copy operations. This backup exit is passed two ¯ags. The command stream executed in an OS/2 shell is:

"e:\util\backup.cmd \i \t"

The second occurrence of the keyword illustrates how to use it in the context of a RULE clause. In this example, an encryption program will run against each source ®le speci®cation. The exit program is passed the \k:347867 key option, the value for the source speci®cation, and the value for the target speci®cation. In this example, the command stream executed in an OS/2 shell is:

"encrypt \k:347867 d:\demoapp\a.exe f:\demoapp\bin":

The package ®le looks like this:

(DATA

(PACKAGEFORMAT gather) (TARGETROOT d:\tcws) (RULE

(SOURCE *.exe *.cmd) (TARGET exe)

#this program will be run for each source file# (EXITPRIOR encrypt \k:347867 )

)

(EXITPRIOR "e:\util\backup.cmd \i \t" )

)

Chapter 17. Using the Gather tool 213

Page 233
Image 233
IBM SC34-4499-03 manual Using exit keywords an example, Package le looks like this