trend_class (version 2.0)
You can also look at:
#! /usr/bin/perl
##############################################################################
#
# SYNTAX: trend_class type
#
# DESCRIPTION: This utility returns the file trend class for a given file type.
# DESCRIPTION: The file class determines which directory it will end up in.
#
# VERSION: 2.0
#
# HISTORY: 0.0 -> 1.0 8/19/96
# HISTORY: Jobpar now has class jobpar.
# HISTORY: 8/23/96 added scraps file
# HISTROY:
# HISTORY: 1.0 -> 1.1 9/11/96
# HISTORY: Added totexpo and totsky, changed gif class to gif1plus.
# HISTORY:
# HISTORY: 1.1 -> 1.2 9/19/96
# HISTORY: Added corimg.
# HISTORY:
# HISTORY: 1.2 -> 1.3 9/26/96
# HISTORY: Now reads from $LISTS/file_classes file instead of having
# HISTORY: a big case statement.
# HISTORY:
# HISTORY: 1.3 -> 2.0 1999-05-07
# HISTORY: Converted from ksh to perl
#
# CALLS: $UTIL/exception
#
##############################################################################
#$DEBUG = 1;
$type = $ARGV[0];
$UTIL = $ENV{"UTIL"};
open FILE_CLASSES, "<$ENV{'LISTS'}/file_classes";
while ( <FILE_CLASSES> ) {
if ( ! /^#/ ) {
if ( /^$type/ ) {
($filetype, $tape_class, $trend_class, $descr) = split /\|/, $_, 4;
if ( $trend_class ) {
print "$trend_class\n";
$found_class = 1;
}
}
}
}
if ( ! "$found_class" ) {
`$UTIL/exception $0 1 "Unknown file type $type"`;
}
exit 0;