Open System Services Porting Guide (G06.24+, H06.03+)
Table Of Contents
- What’s New in This Manual
- About This Manual
- 1 Introduction to Porting
- 2 The Development Environment
- 3 Useful Porting Tools
- 4 Interoperating Between User Environments
- Purpose of Interoperability
- The OSS User Environment
- OSS Commands for the Guardian User
- Guardian Commands for the UNIX User
- OSS Pathname and Guardian Filename Conversions
- Running the OSS Shell and Commands From TACL
- Running Guardian Commands From the OSS Shell
- Running OSS Processes With Guardian Attributes
- Using OSS Commands to Manage Guardian Objects
- 5 Interoperating Between Programming Environments
- 6 OSS Porting Considerations
- 7 Porting UNIX Applications to the OSS Environment
- 8 Migrating Guardian Applications to the OSS Environment
- General Migration Guidelines
- C Compiler Issues for Guardian Programs
- Using New and Extended Guardian Procedures
- Using OSS Functions in a Guardian Program
- Interoperating With OSS Programs
- Starting an OSS Program From the Guardian Environment
- C Compiler Considerations for OSS Programs
- Porting a Guardian Program to the OSS Environment
- How Arguments Are Passed to the C or C++ Program
- Differences in the Two Run-Time Environments
- Which Run-Time Routines Are Available
- Use of Common Run-Time Environment (CRE) Functions
- Replacing Guardian Procedure Calls With Equivalent OSS Functions
- Which IPC Mechanisms Can Be Used
- Interactions Between Guardian and OSS Functions
- 9 Porting From Specific UNIX Systems
- 10 Native Migration Overview
- 11 Porting or Migrating Sockets Applications
- 12 Porting Threaded Applications
- A Equivalent OSS and UNIX Commands for Guardian Users
- B Equivalent Guardian Commands for OSS and UNIX Users
- C Equivalent Inspect Debugging Commands for dbx Commands
- D Equivalent Native Inspect Debugging Commands for dbx Commands
- E Standard POSIX Threads Functions: Differences Between the Previous and Current Standards
- Glossary
- Index
Interoperating Between User Environments
Open System Services Porting Guide—520573-006
4-17
Editing Files From TACL
Moving Files From the Guardian Environment to the OSS
Environment
You may access EDIT-format files directly from the /G file system with an OSS utility.
Three options for moving files to the OSS environment are provided:
•
The following command copies and converts the EDIT file (type 101) called
$DATA01.REPORTS.JAN94 to the OSS file (type 180) /home/stu01/report in
the correct OSS format:
cp /G/DATA01/REPORTS/JAN94 /home/stu01/report
•
It is possible to read EDIT files into your current OSS workspace for vi or ed. In
the following command sequence, ed creates the /home/stu01/report file.
(This sequence is also possible for vi.)
rm /home/stu01/report
ed /home/stu01/report
r /G/DATA01/REPORTS/JAN94
w
q
In the second command line, /home/stu01/report is automatically created
when starting the ed utility. The r command reads the Guardian file
$DATA01.REPORTS.JAN94 into the ed workspace. When the w command is
executed, the contents of the workspace are written to the /home/stu01/report
file. The /home/stu01/report file is then in standard. The q command
terminates ed.
If the report file does not exist, you do not need to use the rm utility (the first
command line in this example).
•
You can edit a type 180 file in the Guardian environment directly from the OSS
environment, but only with type 180 files:
gtacl -p EDITTOC \$DATA01.REPORTS.JAN94,
\$DATA01.REPORTS.TEMP
vi /G/DATA01/REPORTS/TEMP
Moving Files From the OSS Environment to the Guardian
Environment
An ASCII text file in OSS format can be created in the Guardian environment by almost
any OSS utility: cp, vi, ed, cat, grep, or awk. Many Guardian utilities can process
the OSS file format correctly, giving it a type of 180. (Some Guardian utilities or
programs can require the EDIT-file format: type 101.)
The following example of the cp utility creates a file in OSS format:
cp /home/stu01/report /G/data01/reports/temp2