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

Table Of Contents
Interoperating Between User Environments
Open System Services Porting Guide520573-006
4-24
Manipulating Guardian Files From the OSS Shell
The OSS file system is responsible for enabling the transparent read access of EDIT
files for all programs executing in the OSS environment. Thus, all the standard OSS
utilities—such as cat, more, and grep, and programs that you write—are able to
access EDIT files (type 101) and odd-unstructured files (types 0, 100, and 180). EDIT
files can be read and, by using OSSTTY, they can also be written; odd-unstructured
files can be read and written.
The following example command displays the file $SYSTEM.ZTCPIP.HOSTS:
more /G/system/ztcpip/hosts
The following example command searches for the string ftp in the file
$SYSTEM.ZTCPIP.SERVICES:
grep ftp /G/system/ztcpip/services
The chgrp and chown Utilities
Use the chgrp utility to change the group ownership of a file or directory; use the
chown utility to change the owner of a file or directory.
The Guardian security rules and restrictions apply when an attempt is made to change
the group or user ownership of a file in the /G directory or in a Guardian file system
portion of the /E directory. Group or user ownership of a file can normally be given to a
group or user only by a user with the 65535 super ID. Refer to the Guardian Users
Guide for more information on the Guardian file security features.
The chmod Utility
Use the chmod utility to change permission codes on only OSS files. Access
permissions on a Guardian file cannot be set using chmod. After a file is created in the
/G file system, you cannot change its permissions with chmod.
The cp Utility
You can use the OSS cp utility to copy files in the OSS environment, within the portion
of the Guardian file system accessible through the /G directory, or between different
file systems. By copying files within /G, you obtain the same results as using the
Guardian procedure FUP DUP. A complete binary copy is made, preserving all
attributes.
The following example copies a file within /G and creates another file in /G:
cp /G/data01/stu01/report /G/data01/stu01/reprtold
cp copies ASCII text files (type 180) and untyped files (type 0) from the Guardian
environment to the OSS environment without conversion. EDIT files (type 101) are
converted to ASCII text files. Attempts to copy any other type of file return an error.
The cp utility converts (and truncates, if necessary) OSS pathnames to compatible
Guardian filenames.