RESTOOL(1) MachTen Reference Manual RESTOOL(1)

NAME
restool - provides access to resources in a Macintosh file

SYNOPSIS
restool -c [-eruv] [-R type[,id,...]] -o ofile ifile ...
restool -x [-eruv] [-R type[,id,...]] [-o ofile] ifile ...
restool -i [-bv] ifile ...

DESCRIPTION
The restool utility provides access to and information about resources in
files on Macintosh HFS volumes. The desired access is specified with the
initial argument to restool, and applied to all resources in each ifile
unless a set of resources is designated.

The access function selectors for restool:

-c Copies the designated resource(s) from each ifile to ofile. When
a designated resource already exists in ofile, there are three
possible actions. If the -r option is given, the incoming re-
source replaces the existing resource. If the -u option is giv-
en, the incoming resource is added with a new unique ID. If nei-
ther option is given, the incoming resource is bypassed. The
verbose option (-v), displays the resource type and ID as it is
copied.

-i Displays information about the designated resource(s) from each
ifile. The default output for each resource displays the type,
ID, size, and name. The brief format (-b), produces one line per
resource type, displaying a comma separated list of ID(s). The
verbose format (-v), includes a descriptive header.

-x Cuts the designated resource(s) from each ifile. If ofile is
specified, resources are first copied into it (see -c) and then
cut from ifile only if the copy succeeds. The verbose option
(-v), displays the resource type and ID as it is cut.

The following options modify the behavior of the access function as indi-
cated:

-b Produce brief information output.

-e Apply the access function to all known resources those specified
with the -R option(s).

-o ofile
Specifies the output file to receive copied or cut resources. It
may be an existing file.

-R type[,id,...]
Designates resources for the access function. The Macintosh re-
source type is entered as a four character string. Types which
include non-alphanumeric characters, such as the space, must be
quoted. Specific IDs should immediately follow in a comma sepa-
rated list. All existing IDs for the specified type are assumed
if none are specified. Multiple -R options may be given to des-
ignate multiple resource types (and IDs). If the -e option is
given, the union of all -R options designate the resources to ex-
clude from access.

-r Replace existing resources during copy and cut access.

-u Add resources under a new unique ID when they already exist in

ofile.

-v Produce verbose output.

The options -b and -v are mutually exclusive and should not be used to-
gether. The same is true for the options -r and -u.

The code fragment resource (resource type ’cfrg’ and ID 0) receives spe-
cial handling. The ’cfrg’ resource typically has a single code fragment
information record, however, multiple records are supported. Each record
describes a code fragment, including a size and offset to the shareable
code stored in the data fork. Copying the ’cfrg’ resource from one file
to another actually merges code fragment information records into the
ofile file, as well as copying the corresponding code in the data fork.

DIAGNOSTICS
Exit status is 0 if successful, otherwise an error code comprised of the
following bits:
0x01 invalid command usage
0x02 insuffient system resources
0x04 I/O error encounted on an input file
0x08 I/O error encounted on the output file
0x10 resource access error

SEE ALSO
"Inside Macintosh" documentation series by Addison Wesley.

4.4BSD November 18, 1996 2