IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 9, 2010, 3:32:15 PM (16 years ago)
Author:
bills
Message:

fail if that the supplied file size does not match the file on disk.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/DataStoreServer/scripts/dsreg

    r26829 r27230  
    356356                die "file $path not found";
    357357            }
    358             if (!$file->{bytes}) {
    359                 my @finfo = stat($path);
    360                 unless (@finfo) {
    361                     die ("can't stat $path");
     358            # get the size of the file
     359            my @finfo = stat($path);
     360            unless (@finfo) {
     361                die ("can't stat $path");
     362            }
     363            # if size was supplied make sure that it matches the actual
     364            # size
     365            if ($file->{bytes}) {
     366                my $current_size = $finfo[7];
     367                if ($file->{bytes} != $current_size) {
     368                    die "size on disk: $current_size does not match supplied"
     369                    . " size: $file->{bytes} for $path";
    362370                }
     371            } else {
    363372                $file->{bytes}  = $finfo[7];
    364373            }
Note: See TracChangeset for help on using the changeset viewer.