IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 24894


Ignore:
Timestamp:
Jul 22, 2009, 11:27:18 AM (17 years ago)
Author:
bills
Message:

clean up temporary directories

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippScripts/scripts/receive_file.pl

    r24210 r24894  
    1919use PS::IPP::Metadata::List qw( parse_md_list );
    2020use PS::IPP::Config 1.01 qw( :standard );
    21 use File::Temp qw( tempfile );
     21use File::Temp qw( tempfile tempdir );
    2222use File::Basename qw( basename );
    2323use Carp;
     
    3535}
    3636
    37 my $tempdir = "/tmp";
     37my $temproot = "/tmp";
    3838
    3939# Parse the command-line arguments
     
    7272    defined $workdir;
    7373
    74 $tempdir .= "/$file_id";
     74my $tempdir = tempdir( "$temproot/receive.$file_id.XXXX", CLEANUP => !$save_temps);
    7575
    7676&my_die( "dirinfo is NULL for $component", $file_id, $PS_EXIT_CONFIG_ERROR )
     
    329329}
    330330
    331 if (!$save_temps and -e $filename) {
    332     unlink $filename or &my_die( "Unable to unlink $filename\n", $file_id, $PS_EXIT_UNKNOWN_ERROR);
    333 }
    334331my $mjd_extract = DateTime->now->mjd;   # MJD of finishing extract
    335 
    336332
    337333# All done
Note: See TracChangeset for help on using the changeset viewer.