Name

external criterion interpret, externalcriterioninterpret, kPMExternalCriterionExternalCriterionInterpret — Interpret the output as a number.

Synopsis

external criterion interpret structure { type, source };
type : string, choice, default
source : string, choice, default, optional

Description

Interpret the output as a number.

The output will be first intrepretted as a UTF8 string. The number should be composed of numeric values only.

A decimal value is acceptable but be aware of assumptions regarding internationalisation. Not every locality uses spaces, commas, and decimal places 7in the same way.

If both multiple sources are provided, the first valid numeric value is used. The sources are ordered: stdout, stderr. Thus if stdout and stderr both contains numeric values, the numeric value from stdout is used. Only if stdout does not contain a numeric value, is stderr intrepretted.

Where possible avoid interpretting as criteria. It is better practice to return a boolean response using the exit code, or contains, criterion types.

Fields

type.

type is a string. If type is omitted, the default exit code is used. type must be interpret, kPMExternalCriterionType_Interpret.

source. Sources to interpret.

Output sources to interpret. Up to 16KB of content is retained from the external's stdout and stderr stream. The content is taken from the final bytes output; much like the tail command line tool.

source is a string. If source is omitted, the default pme:stdout is used. source is optional. source must be one of the following three constants:

  • pme:stdout, kPMExternalCriterionSource_PmeStdout.
  • pme:stderr, kPMExternalCriterionSource_PmeStderr.
  • pme:stdout+stderr, kPMExternalCriterionSource_PmeStdoutStderr.