Open System Services Porting Guide (G06.24+, H06.03+)

Table Of Contents
Interoperating Between Programming Environments
Open System Services Porting Guide520573-006
5-10
Accessing Files From the Guardian API
Odd-unstructured files and EDIT files are opened as OSS regular files.
If you want your application to modify odd-unstructured Guardian files, or if your
application uses data stored in odd-unstructured Guardian files or EDIT files, you can
use the interoperability capabilities of the OSS environment and access these files with
OSS functions. If you need to modify EDIT files or open structured files, you can use
Guardian procedures as described in Accessing Files From the Guardian API on
page 5-10.
As an alternative to using Guardian procedures when you cannot accomplish a task
with OSS functions, you might be able to accomplish the task with the Guardian C
functions. Write a separately compiled module using Guardian C functions and link this
module into the OSS program. Whether you can do this depends on whether you can
accomplish the required set of operations with Guardian C functions. Refer to the Open
System Services Programmer’s Guide for more information about calling Guardian C
functions from OSS programs; it includes examples of reading a Guardian file with an
OSS function call.
Accessing Files From the Guardian API
Guardian files can be managed from the Guardian API as described in the Guardian
Programmers Guide and the Guardian Procedure Calls Reference Manual.
OSS files can also be managed from the Guardian API. You would use Guardian
procedures to access OSS files when you need to perform operations that use the
nowait feature of the Guardian environment.
Nowait I/O is the ability of an application process to continue executing in parallel with
read and write operations; the application process runs concurrently with the I/O
operation. The OSS environment uses waited I/O, where an application process is
suspended during read and write operations. The process does not resume execution
until the I/O operations are complete. Nowait I/O does not work on files that have been
opened with the OSS open() function.
When you use a Guardian I/O procedure in nowait mode, you set the maximum
number of concurrent I/O operations that you want to allow and then complete the I/O
operations by calling the AWAITIO[X] procedure. For details on using nowait I/O with
Guardian procedures, refer to the Guardian Programmer’s Guide. The Open System
Services Programmer’s Guide contains an example of using the AWAITIO[X]
procedure to read an OSS file.