From: lewis_no_spam@mazda.mitre.org Sent: Tuesday, January 30, 2001 1:22 PM To: Info-VAX@Mvb.Saic.Com Subject: GZIP companion: UNSQUEEZE.COM This utility GUNZIPs a SQUEEZEd file and then restores the saved RMS attributes. It's less necessary than SQUEEZE.COM, as the file which contains the saved attributes is actually a command procedure, so you can just as easily bypass UNSQUEEZE.COM and execute the .*-UNSQUEEZE* files directly. $! $! UnSqueeze.Com $! $! ENK - 22-Feb-00 $! ENK - 13-Mar-00 check for unsqueeze in name + set security $! $ say :== write sys$output $ say " " $ say "---------------------------------------------------------------------" $ say " " $ say " UnSqueeze.Com executes and then deletes the -UNSQUEEZE com file that" $ say " was generated by Squeeze.Com during file compression." $ say " " $ say " The -UNSQUEEZE com file first checks for an existing file of the same " $ say " name, then calls the standard GUNZIP program to do the decompression." $ say " After decompression, the file attributes and the version number are " $ say " reset to their original values." $ say " " $ say " NOTE: Only one version of a file can be decompressed back into a " $ say " directory " $ say " " $ say " Because GUNZIP is a Unix port, it does not allow for version numbers. " $ say " The only options are to abort or to overwrite any version of a file " $ say " of the same name - the safer option of aborting has been chosen." $ say " " $ say "---------------------------------------------------------------------" $ say " " $ wait 00:00:01 $! $ firstfile = "yes" $ask_file: $ if p1 .eqs. "" $ then $ if f$environment("interactive") $ then $ say " " $ say "Please enter the name of the -UNSQUEEZE file(s) " $ say "Name must contain at least the letters UNSQ " $ inquire p1 "Wild card specification is permitted " $ say " " $ goto ask_file $ else $ say " " $ say "No valid input file specified _ exiting" $ say " " $ exit $ endif $ endif $! $ p1 = f$edit(p1,"compress,trim,upcase") $ p1_length = f$length(p1) $ unsq = f$locate("UNSQ","''p1'") $ if unsq .ge. p1_length $ then $ say " " $ say " ***************************************************************** " $ say " The ''p1' specification does not " $ say " include the letters UNSQ " $ say " ***************************************************************** " $ say " " $ p1 = "" $ goto ask_file $ endif $! $ kntx1 = "2001" $ kntx2 = "2002" $ kntx3 = "2003" $ old_target = "something special" $file_loop: $ target = f$search(p1,kntx1) $! $ if target .eqs. "" $ then $ if firstfile .eqs. "yes" $ then $ firstfile = "no" $ say " " $ say " ****** Can not locate any files with ''p1'" $ say " " $ exit $ else $ exit $ endif $ endif $! $ if target .eqs. old_target $ then $ say " " $ say " *********************** abort ********************************** " $ say " UnSqueeze looping " $ say " keep finding ''target' " $ say " while searching for ''p1' " $ say " *********************** abort ********************************** " $ say " " $ exit $ endif $ old_target = target $! $ firstfile = "no" $! $ type = f$parse(target,,,"type") $ typlen = f$length(type) $ addpoint = f$locate("-UNSQUEEZE-V",type) $ if addpoint .ge. typlen $ then $ say " " $ say " ''target' " $ say " is not a valid UnSqueeze file - resuming search " $ say " for ''p1' " $ say " " $ goto file_loop $ endif $! $ archive_loc = f$parse(target,,,"device") + f$parse(target,,,"directory") $ filename = f$parse(target,,,"name") $ filetype = f$extract(0,addpoint,type) $ filevers = f$extract(addpoint+12,typlen-addpoint,type) $! $ basename = archive_loc + filename + filetype $ gzname = basename + "-GZ-V" + filevers $! $ if f$search("''gzname'",kntx2) .eqs. "" $ then $ say " " $ say " ****** Can not locate compressed file $ say " " $ wait 00:00:04 $ goto file_loop $ endif $! $ found = f$search("''basename'",kntx3) $ if found .nes. "" $ then $ say " " $ say " ****** Can not do the decompression - file already exists " $ say " ****** found ''found' " $ say " " $ say " ****** ''target' " $ say " " $ wait 00:00:04 $ goto file_loop $ endif $! $ @ 'target' $ set security/nolog/class=file/like=name='target' 'basename' $! $ say " " $ delete/log 'target' $! $ say " " $ goto file_loop --Keith Lewis klewis_no_spam@mitre.org PGP key available. The above may not (yet) represent the opinions of my employer.