DirectNET

Data Center Management Solutions including UPS Systems, Data Center Cooling, KVM over IP & IP Power Strips, Server Racks and Server Rack accessories; KVM Switches and KVM Extenders; Rackmount Monitors and Rackmount Keyboards.


NAVIGATION
Home
Store
INSIDE MAC
Television Shows
Broadcast Shows
Daily News Shows
Special Shows
EVENTS
DAILY TIPS
Design
Mac OS X
Mac OS X UNIX
COMMUNITY
Surveys
NEWS
Current
Press
Archive
FEATURES
Editorial
Dr. Mac
Reviews
Reader Reports
RESOURCES
FAQ
Documentation
Learning Center
MAN pages
Glossary
Tutorials
Tips
Links

OUR PARTNERS


     #include <ar.h>


DESCRIPTION

     The archive command ar combines several files into one.  Archives are
     mainly used as libraries of object files intended to be loaded using the
     link-editor ld(1).

     A file created with ar begins with the ``magic'' string "!<arch>\n".  The
     rest of the archive is made up of objects, each of which is composed of a
     header for a file, a possible file name, and the file contents.  The
     header is portable between machine architectures, and, if the file con-
     tents are printable, the archive is itself printable.

     The header is made up of six variable length ASCII fields, followed by a
     two character trailer.  The fields are the object name (16 characters),
     the file last modification time (12 characters), the user and group id's
     (each 6 characters), the file mode (8 characters) and the file size (10
     characters).  All numeric fields are in decimal, except for the file mode
     which is in octal.

     The modification time is the file st_mtime field, i.e., CUT seconds since
     the epoch.  The user and group id's are the file st_uid and st_gid
     fields.  The file mode is the file st_mode field.  The file size is the
     file st_size field.  The two-byte trailer is the string "`\n".

     Only the name field has any provision for overflow.  If any file name is
     more than 16 characters in length or contains an embedded space, the
     string "#1/" followed by the ASCII length of the name is written in the
     name field.  The file size (stored in the archive header) is incremented
     by the length of the name.  The name is then written immediately follow-
     ing the archive header.

     Any unused characters in any of these fields are written as space charac-
     ters.  If any fields are their particular maximum number of characters in
     length, there will be no separation between the fields.

     Objects in the archive are always an even number of bytes long; files
     which are an odd number of bytes long are padded with a newline (``\n'')
     character, although the size in the header does not reflect this.


SEE ALSO

     ar(1),  stat(2)


HISTORY

     There have been at least four ar formats.  The first was denoted by the
     leading ``magic'' number 0177555 (stored as type int).  These archives
     were almost certainly created on a 16-bit machine, and contain headers
     made up of five fields.  The fields are the object name (8 characters),
     the file last modification time (type long), the user id (type char), the
     file mode (type char) and the file size (type unsigned int).  Files were
     padded to an even number of bytes.



COMPATIBILITY

     No archive format is currently specified by any standard.  AT&T System V
     UNIX has historically distributed archives in a different format from all
     of the above.

BSD Experimental                 June 9, 1993                                2

Copyright © 2000-2010 Inside Mac Media, Inc. All rights reserved.
Apple assumes no responsibility with regard to the selection, performance, or use of the products or services. All understandings, agreements, or warranties, if any, take place directly between the vendors and prospective users.
Apple, the Apple logo, Mac, PowerMac G4, PowerMac G5, Xserve, Xserve RAID, PowerBook, iBook, Airport, AirPort Extreme, iMac, eMac, iLife, iMovie, iCal, iPhoto, iTunes, QuickTime, FireWire, iPod, iSight, AppleWorks, Macintosh, Jaguar, Panther, Mac OS, Mac OS X and Mac OS X Server are trademarks of Apple Computer, Inc.