Tools: MPW
Advanced Search
Apple Developer Connection
Member Login Log In | Not a Member? Support

MPW Command Reference


VersionList

Tool

SYNTAX

VersionList [file1] [file2]… [-all] [-c creator] [-d] [-h] [-l] [-lv]
[-newer date] [-noResolve] [-older date] [-p] [-r] [-raw] [-s] [-t type]
[-u path] [-v] [-y4]

DESCRIPTION

The VersionList command lists version information for files. Using the VersionList command you can

report version information for all files (-all), specific files (file1 file2), certain creator types (-c creator), or certain file types (-t type)

include modification dates and software bundle version in the report (-d, -lv, -v)

generate report data for only the files whose last modification date is newer or older than a certain date (-newer date or -older date)

control the formatting of VersionList reports (-h, -l, -raw, -s, -y4)

ask VersionList to search recursively (-r) for your file

ask VersionList to search starting at a specific root path (-u path)

generate progress information (-p)

VersionList gets the version numbers from the short version strings in the 'vers' resources. If no files or options are specified, VersionList reports the version numbers of the MPW tools in the "{MPW}"Tools: directory.

INPUT

None

OUTPUT

The report is sent to standard output unless redirected to a file. The default report consists of the file's name and version. If a file's name is too long for the File Name column, it will be truncated to fit. If a version resource is not found for a file, "n/a" (not available) is printed instead. If there is a file error while attempting to read the version resource, "err" is printed and a more descriptive error message will be sent to the diagnostic output.

ALIAS RESOLUTION

Resolves Finder aliases used as part of any pathname or filename, unless you use the -noResolve option to display information for alias files. To avoid infinite loops, VersionList does not resolve folder aliases when you specify the -r (recursive) option.

STATUS

VersionList can return the following status codes:

0

no errors

1

syntax error

2

execution error

3

system error or insufficient resources

-9

user abort

PARAMETERS

[file1] [file2]…

Specifies one or more files by name. A file may be specified using a full pathname, a partial pathname, or a plain filename. If the file is specified using a partial pathname, VersionList will search the "current" directory for the file. Note that a file in the "current" directory must be specified with a leading colon. If the file is specified as a plain filename, VersionList will search either the "{MPW}"Tools: directory (the default) or the directory specified using the -u option. If no files are specified, VersionList reports the version numbers of the MPW tools in the "{MPW}"Tools: directory.

OPTIONS

-all

Prints version information for all files in the directory. When this option is specified, the options -t and -c are ignored.

-c creator

Reports on files that have the specified file creator. If you don't specify a creator, then VersionList reports on files with the file creator 'MPS '.

-d

Prints modification dates as well as file version information in the report.

-h

Suppresses the header and footer of the report.

-l

Preserves long filenames by not truncating them.

-lv

Prints the long version string from the 'vers' (2) resource in the report.

-newer date

Reports on files that are newer than the specified modification date, where date is specified using the currently selected format in the Date & Time Control Panel, for example

"mm/dd/[yy]yy [hh:mm[:ss] [AM | PM]]"

The date can also be specified using the MPW uniform format shown below

"yyyymmdd hh:mm:ss"  (Note: ◊ is Option-Shift-v.)

where yyyy, mm, and dd represent the year, month, and day; and hh, mm, and ss represent the hour, minute, and second. Note that when specifying the hour, the values 0 thru 11 indicate A.M. time while the values 12 thru 23 indicate P.M. time.

Note that you must enclose the string in quotation marks if it contains spaces and that, as a convenience, you can use a period (.) to indicate the current date and time.

-noResolve

Suppresses alias resolution for filenames so you can display version information for alias files. Does not suppress alias resolution in the path specified with the -u option.

-older date

Reports on files that are older than the specified modification date, where date is specified using the currently selected format in the Date & Time Control Panel, for example

"mm/dd/[yy]yy [hh:mm[:ss] [AM | PM]]"

The date can also be specified using the MPW uniform format shown below

"yyyymmdd hh:mm:ss"  (Note: ◊ is Option-Shift-v.)

where yyyy, mm, and dd represent the year, month, and day; and hh, mm, and ss represent the hour, minute, and second. Note that when specifying the hour, the values 0 thru 11 indicate A.M. time while the values 12 thru 23 indicate P.M. time.

Note that you must enclose the string in quotation marks if it contains spaces and that, as a convenience, you can use a period (.) to indicate the current date and time.

-p

Prints progress information to standard output.

-r

Searches recursively through all subdirectories for files. The default starting point for the search is the "{MPW}"Tools: directory. You can specify a different starting directory with the -u path option.

-raw

Prints unformatted (raw) data in tab-delimited columns.

-s

Prints an abbreviated header.

-t type

Reports on files that have the specified type. If you don't specify a file type, VersionList reports on MPW tools (type'MPST').

-u path

Searches the directory path for files. VersionList uses the default directory {MPW}Tools: unless you specify the directory path with this option.

-v

Prints the bundle version ('vers' (2) resource) as well as file version information in the report.

-y4

Prints years as four-digit numbers in the report.

EXAMPLES

The command line

VersionList -u "Degas:Applications:" -t 'APPL'

generates a list of all the applications in the root level of the directory "Degas:Applications:"

Listing 1: VersionList report

# ------------------------------------------------------------------
# VersionList Report
# Report Date: 11/17/96
# Report Root: "Degas:Applications:"

# File Name          Version
# ------------------------------------------------------------------

  Apple DocViewer    1.0
  Disk Copy          4.2
  ClarisWorks        4.0

# ------------------------------------------------------------------
# 3 files were found matching your description.
# A total of 3 files were found.
# ------------------------------------------------------------------

VersionList searches through all the subdirectories of the stated directory if you specify the -r option.

versionList -r -u "maryHartman:" -t 'APPL' -v

The report shown in Listing 2 shows the release version resource, produced by the option (-v), as well as a recursive listing.

Listing 2: A recursively generated VersionList report

# ------------------------------------------------------------------
# VersionList Report
# Report Date: 11/17/96
# Report Root: "maryHartman:"

# File Name             Version     Release 
# ------------------------------------------------------------------

      HyperCard         2.1         n/a

  Apple DiskCopy 4.2:
      Disk Copy         4.2         n/a

  cc's stuff:
      Event Monitor     n/a         n/a
      EventDemo2/26     n/a         n/a
      HeapDemo 1.3.3    1.3.3       n/a
      QD Demo 1.4d5     1.4d5       n/a
      sample            n/a         n/a

  cc's stuff:TMON Folder:
      TMON              3.0.1       3.0.1

  TestApp 3.1:
      TestApp Graph     1.1 ©1995…  n/a
      TestApp 3.1       3.1 ©1996…  n/a
      TestApp Library   3.1 ©1996…  n/a

# ------------------------------------------------------------------
# 11 files were found matching your description.
# A total of 11 files were found.
# ------------------------------------------------------------------

To find a file of a type other than an MPW tool, you must specify the type you want using the -t type option. The command line

versionList "TMON" -r -u "maryHartman:" -t 'APPL'

searches through all the subdirectories of "maryHartman:" to find the TMON application and generates this report:

# ------------------------------------------------------------------
# VersionList Report
# Report Date: 11/17/96
# Report Root: "maryHartman:"

# File Name             Version
# ------------------------------------------------------------------

  cc's stuff:TMON Folder:
      TMON              3.0.1

# ------------------------------------------------------------------
# 1 file was found matching your description.
# A total of 11 files were found.
# ------------------------------------------------------------------

 
 


Last Updated June 2001