Changeset 23249 for main


Ignore:
Timestamp:
2010-10-29T15:00:58+13:00 (13 years ago)
Author:
ak19
Message:

A useful debug version of the rm method which got added in when Dr Bainbridge fixed the mimetype file deleting issue (commit 23248).

Location:
main/trunk/greenstone2/perllib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/classify/List.pm

    r23154 r23249  
    270270        # Unicode/Collate directory.
    271271    require Unicode::Collate;
     272    #print STDERR "*** What's in INC: ".join(", ", @INC) ."\n";
    272273    $self->{'unicode_collator'} = Unicode::Collate->new();
     274    #print STDERR "Table name: ".$self->{'unicode_collator'}->{'table'}."\n";
    273275    }
    274276
  • main/trunk/greenstone2/perllib/util.pm

    r22886 r23249  
    5959}
    6060
     61# removes files (but not directories) - can rename this to the default
     62# "rm" subroutine  when debugging the deletion of individual files.
     63sub rm_debug {
     64    my (@files) = @_;
     65    my @filefiles = ();
     66
     67    # make sure the files we want to delete exist
     68    # and are regular files
     69    foreach my $file (@files) {
     70        if (!-e $file) {
     71            print STDERR "util::rm $file does not exist\n";
     72        } elsif ((!-f $file) && (!-l $file)) {
     73            print STDERR "util::rm $file is not a regular (or symbolic) file\n";
     74        } else { # debug message
     75            unlink($file) or warn "Could not delete file $file: $!\n";
     76        }
     77    }
     78}
    6179
    6280
Note: See TracChangeset for help on using the changeset viewer.