Open System Services Shell and Utilities Reference Manual (G06.28+, H06.05+)
User Commands (a - b) ar(1)
file obey_file, you must specify one and only one flag from the required-flag set
dmpqrtx. You can also specify any number of optional flags from the set abcil-
suvCT. If you select one of the positioning flags (a, b,ori), you must also
specify the name of a file within the library (position_name) immediately follow-
ing the flag list and separated from it by a space.
-x Extracts the files identified in the file operands from the archive specified in the
archive operand. The contents of the archive file are not changed. If no file
operands are specified, all files in the archive are extracted. If the filename of a
file to be extracted from the archive is longer than the name length supported for
the target directory, an error results and, unless -T has also been specified, the
file is not extracted. If -T has also been specified, the file is extracted and given
a truncated filename. The modification time of each extracted file is set to the
time the file is extracted from the archive.
DESCRIPTION
The ar command creates and maintains groups of one or more named files as a single archive
(library) file written in ar archive format. After an archive file has been created, new files can be
added to the archive file, and existing files can be extracted from it, deleted, or replaced.
The ar command accepts the following as archive members:
• All OSS files
• Guardian TNS code files
• Accelerated object files
• Guardian C text files (file code 180 files)
• TNS/R (PIC and non-PIC) native object files
• TNS/E native linkfiles or loadfiles
You can mix one or more object file formats in one archive file. However, such an archive file
cannot be used by the Binder or the nld, ld,oreld utility.
If an archive file contains only files in a single object file format, an archive symbol table is
created as the first file member of the archive file. The format of this table depends upon the
linker utility for the corresponding object file format. This table is maintained by ar and used by
the Binder (for TNS and accelerated object files), the nld utility (for TNS/R native non-PIC
object files), the ld utility (for TNS/R native PIC object files), and the eld utility (for TNS/E
native PIC files) to search the archive file and extract archive members from it.
When the ar utility is used to create or update the content of such an archive, the symbol table is
rebuilt automatically. The -s flag forces the symbol table to be rebuilt.
An archive file embedded as a member of another archive file is not used by the Binder or the nld
utility, the ld utility, or the eld utility.
All file operands can be pathnames. However, files within archive files are given a filename,
which is the last component of the pathname used when the file was entered into the archive file.
Multiple files within the archive file can be identically named. In these cases, each file and
position_name operand matches only the first archive file having a name that is the same as the
last component of the file or position_name operand.
An archive file can be created for the OSS, Guardian, or a target-independent execution environ-
ment. An OSS archive file is made up of OSS and target-independent object files. A Guardian
archive file is made up of Guardian and target-independent object files. A target-independent
527188-007 Hewlett-Packard Company 1−9