Changeset 31187

Show
Ignore:
Timestamp:
09.12.2016 21:21:29 (3 years ago)
Author:
ak19
Message:

Useful changes not specifically related to upcoming oaiinfo db related commit.

Location:
main/trunk/greenstone2/perllib
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/FileUtils.pm

    r28565 r31187  
    4343# util::cp_r_nosvn()           => FileUtils::copyFilesRecursiveNoSVN() 
    4444# util::cp_r_toplevel()        => FileUtils::copyFilesRecursiveTopLevel() 
    45 # util::differentfiles()      => FileUtils::differentFiles() 
     45# util::differentfiles()       => FileUtils::differentFiles() 
    4646# util::dir_exists()           => FileUtils::directoryExists() 
    4747# util::fd_exists()            => FileUtils::fileTest() 
  • main/trunk/greenstone2/perllib/arcinfo.pm

    r28637 r31187  
    7979    my ($filename) = @_; 
    8080 
    81     if (defined $filename && -e $filename) { 
     81    if (defined $filename && &FileUtils::fileExists($filename)) { 
    8282    open (INFILE, $filename) ||  
    8383        die "arcinfo::load_info couldn't read $filename\n"; 
     
    125125    $self->{'info'} = {}; 
    126126 
    127     if ((defined $filename) && (-e $filename)) { 
     127    if ((defined $filename) && &FileUtils::fileExists($filename)) { 
    128128    if ($filename =~ m/\.inf$/) { 
    129129        $self->_load_info_txt($filename); 
     
    158158    $self->{'import-filelist'} = {}; 
    159159 
    160     if ((defined $filename) && (-e $filename)) { 
     160    if ((defined $filename) && &FileUtils::fileExists($filename)) { 
    161161    if ($filename =~ m/\.inf$/) { 
    162162        # e.g. 'archives-src.inf' (which includes complete list of file 
     
    186186 
    187187    foreach my $OID ($vals =~ m/^<oid>(.*)$/gm) { 
    188         $self->add_revinfo($srcfile,$OID); 
     188        $self->add_reverseinfo($srcfile,$OID); 
    189189    } 
    190190    } 
  • main/trunk/greenstone2/perllib/util.pm

    r30575 r31187  
    340340 
    341341    return $tmp_dirname; 
     342} 
     343 
     344sub get_parent_folder 
     345{ 
     346    my ($path) = @_; 
     347    my ($tailname, $dirname, $suffix) 
     348    = &File::Basename::fileparse($path, "\\.[^\\.]+\$"); 
     349 
     350    return &FileUtils::sanitizePath($dirname); 
    342351} 
    343352