bpi.readpath()

bpi.readpath()

This subroutine is provided to allow cross-platform (unidata/uniVerse/etc) read path capability. The subroutine allows the developer to target a specific file  by path and it will return the content of that file in the return variable.

Subroutine Syntax

CALL bpi.readpath( path, hdl_dir, doc, ioctl_type, error, message )

Parameters

Param

Direction

Description

path

passed

path to read

hdl_dir

returned

is the handle to directory in path (param)

ioctl_type

passed

is a IOCTL code passed to the read see your multivalue platforms documentation for support for IOCTL.  The default is "RB" which stands for Read Binary

doc

returned

The content of the file

error

returned

success is zero and all other indicates error

message

returned

A descriptive message related to the error (if available on platform)

 Example

This example demonstrates how you could use this subroutine to poll a file until it reaches steady-state at which point your program can proceed.

steadyState = @false
lastDoc = \\; lastLastDoc = \\;pdfDocument=\\
LOOP
   UNTIL (steadyState) DO
       CALL bpi.readpath( full_path, hdl_dir, pdfDocument ioctl_type, error, message )
        IF NOT(error) THEN
           IF (lastLastDoc) EQ lastDoc AND ( lastDoc EQ pdfDocument) THEN
               steadyState = @TRUE
           END ELSE
               lastLastDoc = lastDoc
               lastDoc = pdfDocument
nap 50; * half second

           END
       END
REPEAT