Changeset 29973 for trunk/ippScripts/scripts/receive_file.pl
- Timestamp:
- Dec 7, 2010, 11:14:41 AM (15 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/receive_file.pl (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/receive_file.pl
r29574 r29973 32 32 my $receivetool = can_run('receivetool') or (warn "Can't find receivetool" and $missing_tools = 1); 33 33 my $dsproductls = can_run('dsfilesetls') or (warn "Can't find dsfilesetls" and $missing_tools = 1); 34 my $gunzip = can_run('gunzip') or (warn "Can't find gunzip" and $missing_tools = 1); 34 35 if ($missing_tools) { 35 36 warn("Can't find required tools."); … … 404 405 my $workdir = shift; 405 406 407 my $filecmd_output = `file $src`; 408 &my_die("failed to determinte file type of $src", $file_id, $PS_EXIT_UNKNOWN_ERROR) if !$filecmd_output; 409 chomp $filecmd_output; 410 411 my $tmpName; 412 if ($filecmd_output =~ /gzip/) { 413 my $tmpfile; 414 ($tmpfile, $tmpName) = tempfile( "/tmp/receive.XXXX", UNLINK => !$save_temps ); 415 close($tmpfile) or &my_die("failed to close $tmpName", $file_id, $PS_EXIT_UNKNOWN_ERROR); 416 417 my $command = "$gunzip -c $src > $tmpName"; 418 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 419 run(command => $command, verbose => $verbose); 420 unless ($success) { 421 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 422 &my_die("Unable to perform $command: $error_code", $component, $error_code); 423 } 424 $src = $tmpName; 425 } 426 406 427 open my $IN, "<$src" or &my_die("failed to open $src for input", $file_id, $PS_EXIT_UNKNOWN_ERROR); 407 428 open my $OUT, ">$dest" or &my_die("failed to open $dest for output", $file_id, $PS_EXIT_UNKNOWN_ERROR);
Note:
See TracChangeset
for help on using the changeset viewer.
