Changeset 27306

Show
Ignore:
Timestamp:
06.05.2013 15:29:38 (6 years ago)
Author:
jmt12
Message:

Moving the critical file-related functions (copy, rm, etc) out of util.pm into their own proper class FileUtils?. Use of the old functions in util.pm will prompt deprecated warning messages. There may be further functions that could be moved across in the future, but these are the critical ones when considering supporting other filesystems (HTTP, HDFS, WebDav?, etc). Updated some key files to use the new functions so now deprecated messages thrown when importing/building demo collection 'out of the box'

Location:
main/trunk/greenstone2/perllib
Files:
1 added
17 modified

Legend:

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

    r27192 r27306  
    3535use plugin; 
    3636use util; 
     37use FileUtils; 
    3738 
    3839 
     
    248249    if (!$self->{'debug'} && !$self->{'keepold'}) { 
    249250    # remove any old builds 
    250     &util::rm_r($self->{'build_dir'}); 
    251     &util::mk_all_dir($self->{'build_dir'}); 
     251    &FileUtils::removeFilesRecursive($self->{'build_dir'}); 
     252    &FileUtils::makeAllDirectories($self->{'build_dir'}); 
    252253         
    253254    # make the text directory 
    254255    my $textdir = "$self->{'build_dir'}/text"; 
    255     &util::mk_all_dir($textdir); 
     256    &FileUtils::makeAllDirectories($textdir); 
    256257    } 
    257258 
     
    404405    print STDERR "BuildDir: $self->{'build_dir'}\n"; 
    405406 
    406     my $textdir = &util::filename_cat($self->{'build_dir'}, "text"); 
    407     my $assocdir = &util::filename_cat($self->{'build_dir'}, "assoc"); 
    408     &util::mk_all_dir ($textdir); 
    409     &util::mk_all_dir ($assocdir); 
     407    my $textdir = &FileUtils::filenameConcatenate($self->{'build_dir'}, "text"); 
     408    my $assocdir = &FileUtils::filenameConcatenate($self->{'build_dir'}, "assoc"); 
     409    &FileUtils::makeAllDirectories ($textdir); 
     410    &FileUtils::makeAllDirectories ($assocdir); 
    410411 
    411412    # Get info database file path 
     
    541542 
    542543    # get the text directory 
    543     &util::mk_all_dir ($self->{'build_dir'}); 
     544    &FileUtils::makeAllDirectories ($self->{'build_dir'}); 
    544545 
    545546    # store the build date 
     
    596597     
    597598    # write out the earliestDatestamp information needed for OAI 
    598     my $archivedir = &util::filename_cat ($ENV{'GSDLCOLLECTDIR'}, "archives"); 
     599    my $archivedir = &FileUtils::filenameConcatenate($ENV{'GSDLCOLLECTDIR'}, "archives"); 
    599600    if(!-d $archivedir) { 
    600     $archivedir = &util::filename_cat ($ENV{'GSDLCOLLECTDIR'}, "export"); 
    601     } 
    602     my $earliestDatestampFile = &util::filename_cat ($archivedir, "earliestDatestamp"); 
     601    $archivedir = &FileUtils::filenameConcatenate($ENV{'GSDLCOLLECTDIR'}, "export"); 
     602    } 
     603    my $earliestDatestampFile = &FileUtils::filenameConcatenate($archivedir, "earliestDatestamp"); 
    603604    my $earliestDatestamp = 0; 
    604605    if (open(FIN,"<$earliestDatestampFile")) { 
     
    620621 
    621622    if ($gs_mode eq "gs2") { 
    622       &colcfg::write_build_cfg(&util::filename_cat($self->{'build_dir'},"build.cfg"), $build_cfg); 
     623      &colcfg::write_build_cfg(&FileUtils::filenameConcatenate($self->{'build_dir'},"build.cfg"), $build_cfg); 
    623624    } 
    624625    if ($gs_mode eq "gs3") { 
    625626 
    626       &colcfg::write_build_cfg_xml(&util::filename_cat($self->{'build_dir'}, "buildConfig.xml"), $build_cfg, $self->{'collect_cfg_preserve'}); 
     627      &colcfg::write_build_cfg_xml(&FileUtils::filenameConcatenate($self->{'build_dir'}, "buildConfig.xml"), $build_cfg, $self->{'collect_cfg_preserve'}); 
    627628    }     
    628629 
     
    766767    } 
    767768     
    768     my $buildconfigfile = &util::filename_cat($self->{'build_dir'}, $buildconfigfilename); 
     769    my $buildconfigfile = &FileUtils::filenameConcatenate($self->{'build_dir'}, $buildconfigfilename); 
    769770     
    770771    if (!-e $buildconfigfile) { 
    771772    # try the index dir - but do we know where it is?? try here 
    772     $buildconfigfile  = &util::filename_cat($ENV{'GSDLCOLLECTDIR'}, "index", $buildconfigfilename); 
     773    $buildconfigfile  = &FileUtils::filenameConcatenate($ENV{'GSDLCOLLECTDIR'}, "index", $buildconfigfilename); 
    773774    if (!-e $buildconfigfile) { 
    774775        #we cant find a config file - just ignore the field list 
  • main/trunk/greenstone2/perllib/basebuildproc.pm

    r27188 r27306  
    3939no strict 'refs'; 
    4040use util; 
     41use FileUtils; 
    4142 
    4243BEGIN { 
     
    7879    # For incremental building need to seed num_docs etc from values 
    7980    # stored in build.cfg (if present) 
    80     $buildconfigfile = &util::filename_cat($build_dir, "build.cfg"); 
     81    $buildconfigfile = &FileUtils::filenameConcatenate($build_dir, "build.cfg"); 
    8182    if (-e $buildconfigfile) { 
    8283        $found_num_data = 1; 
     
    8485    else { 
    8586        # try the index dir 
    86         $buildconfigfile = &util::filename_cat($ENV{'GSDLCOLLECTDIR'},  
     87        $buildconfigfile = &FileUtils::filenameConcatenate($ENV{'GSDLCOLLECTDIR'},  
    8788                           "index", "build.cfg"); 
    8889        if (-e $buildconfigfile) { 
     
    835836    # dir, otherwise it is relative to the HASH... directory 
    836837    if ($assoc_file->[1] =~ m@^[/\\]@) { 
    837         $afile = &util::filename_cat($self->{'assocdir'}, $assoc_file->[1]); 
     838        $afile = &FileUtils::filenameConcatenate($self->{'assocdir'}, $assoc_file->[1]); 
    838839    } else { 
    839         $afile = &util::filename_cat($self->{'assocdir'}, $archivedir, $assoc_file->[1]); 
     840        $afile = &FileUtils::filenameConcatenate($self->{'assocdir'}, $archivedir, $assoc_file->[1]); 
    840841    } 
    841842     
    842     &util::hard_link ($assoc_file->[0], $afile, $self->{'verbosity'}); 
     843    &FileUtils::hardLink($assoc_file->[0], $afile, $self->{'verbosity'}); 
    843844    } 
    844845} 
     
    849850    my ($archivedir, $edit_mode) = @_; 
    850851 
    851     my $assoc_dir = &util::filename_cat($self->{'assocdir'}, $archivedir); 
     852    my $assoc_dir = &FileUtils::filenameConcatenate($self->{'assocdir'}, $archivedir); 
    852853    if (-d $assoc_dir) { 
    853     &util::rm_r($assoc_dir); 
    854     } 
    855 } 
     854    &FileUtils::removeFilesRecursive($assoc_dir); 
     855    } 
     856} 
  • main/trunk/greenstone2/perllib/colcfg.pm

    r27189 r27306  
    3131use cfgread; 
    3232use gsprintf 'gsprintf'; 
     33use util; 
     34use FileUtils; 
     35 
    3336use strict; 
    3437 
     
    268271    # gsdl/collect/COLLECTION/custom/COLLECTION/etc/custom.cfg file. This 
    269272    # customization was added for DLC by Stefan, 30/6/2007. 
    270     my $configfilename = &util::filename_cat ($ENV{'GSDLCOLLECTDIR'}, "custom", $ENV{'GSDLCOLLECTION'}, "etc", "custom.cfg"); 
     273    my $configfilename = &FileUtils::filenameConcatenate ($ENV{'GSDLCOLLECTDIR'}, "custom", $ENV{'GSDLCOLLECTION'}, "etc", "custom.cfg"); 
    271274 
    272275    if (-e $configfilename) { 
     
    275278 
    276279    # Check if there is a collectionConfig.xml file. If there is one, it's gs3 
    277     $configfilename = &util::filename_cat ($ENV{'GSDLCOLLECTDIR'}, "etc", "collectionConfig.xml");     
     280    $configfilename = &FileUtils::filenameConcatenate ($ENV{'GSDLCOLLECTDIR'}, "etc", "collectionConfig.xml");     
    278281    if (-e $configfilename) { 
    279282        return ($configfilename, "gs3"); 
     
    281284 
    282285    # If we get to here we check if there is a collect.cfg file in the usual place, i.e. it is gs2. 
    283     $configfilename = &util::filename_cat ($ENV{'GSDLCOLLECTDIR'}, "etc", "collect.cfg"); 
     286    $configfilename = &FileUtils::filenameConcatenate ($ENV{'GSDLCOLLECTDIR'}, "etc", "collect.cfg"); 
    284287    if (-e $configfilename) { 
    285288        return ($configfilename, "gs2"); 
     
    304307 
    305308    if($gs_version eq "gs2") { 
    306     $configfilename = &util::filename_cat ($ENV{'GSDLCOLLECTDIR'}, "custom", $ENV{'GSDLCOLLECTION'}, "etc", "custom.cfg"); 
     309    $configfilename = &FileUtils::filenameConcatenate ($ENV{'GSDLCOLLECTDIR'}, "custom", $ENV{'GSDLCOLLECTION'}, "etc", "custom.cfg"); 
    307310     
    308311    if (-e $configfilename) { 
     
    313316    # Check if there is a collectionConfig.xml file if it's gs3 
    314317    if($gs_version eq "gs3") { 
    315     $configfilename = &util::filename_cat ($ENV{'GSDLCOLLECTDIR'}, "etc", "collectionConfig.xml");     
     318    $configfilename = &FileUtils::filenameConcatenate ($ENV{'GSDLCOLLECTDIR'}, "etc", "collectionConfig.xml");     
    316319    if (-e $configfilename) { 
    317320        return $configfilename; 
     
    321324    # Check if there is a collect.cfg file in the usual place for gs2. 
    322325    if($gs_version eq "gs2") { 
    323     $configfilename = &util::filename_cat ($ENV{'GSDLCOLLECTDIR'}, "etc", "collect.cfg"); 
     326    $configfilename = &FileUtils::filenameConcatenate ($ENV{'GSDLCOLLECTDIR'}, "etc", "collect.cfg"); 
    324327    if (-e $configfilename) { 
    325328        return $configfilename; 
  • main/trunk/greenstone2/perllib/dbutil/gdbm.pm

    r23758 r27306  
    2929use strict; 
    3030 
     31use util; 
     32use FileUtils; 
    3133use dbutil::gdbmtxtgz; 
    3234 
     
    4042  my $opt_append = shift(@_); 
    4143 
    42   my $txt2db_exe = &util::filename_cat($ENV{'GSDLHOME'},"bin",$ENV{'GSDLOS'}, "txt2db" . &util::get_os_exe()); 
     44  my $txt2db_exe = &FileUtils::filenameConcatenate($ENV{'GSDLHOME'},"bin",$ENV{'GSDLOS'}, "txt2db" . &util::get_os_exe()); 
    4345  my $infodb_file_handle = undef; 
    4446  my $cmd = "\"$txt2db_exe\""; 
     
    8486  my $infodb_file_extension = ".gdb"; 
    8587  my $infodb_file_name = &util::get_dirsep_tail($collection_name) . $infodb_file_extension; 
    86   return &util::filename_cat($infodb_directory_path, $infodb_file_name); 
     88  return &FileUtils::filenameConcatenate($infodb_directory_path, $infodb_file_name); 
    8789} 
    8890 
  • main/trunk/greenstone2/perllib/doc.pm

    r26850 r27306  
    3737use unicode; 
    3838use util; 
     39use FileUtils; 
    3940use ghtml; 
    4041use File::stat; 
     
    8990    $self->{'terse_source_path'} = $source_filename; 
    9091 
     92        # Use the FileUtil library methods as they are aware of more special 
     93        # cases such as HDFS [jmt12] 
     94    ##if (&util::file_exists($source_filename)) { 
    9195    if (-e $source_filename) { 
    9296        # See if we can do better for Windows with a filename 
     
    241245#    print STDERR "-> $srcfilename -> "; 
    242246#    $srcfilename = &util::rename_file($srcfilename.$suffix, $rename_method); 
    243 #    $source_filename = &util::filename_cat($dirname, $srcfilename); 
     247#    $source_filename = &FileUtils::filenameConcatenate($dirname, $srcfilename); 
    244248#    print STDERR "$source_filename\n"; 
    245249     
     
    257261#    print STDERR "-> $srcfilename -> "; 
    258262    $srcfilename = &util::rename_file($srcfilename.$suffix, $rename_method); 
    259     $source_filename = &util::filename_cat($dirname, $srcfilename); 
     263    $source_filename = &FileUtils::filenameConcatenate($dirname, $srcfilename); 
    260264 
    261265    return $source_filename; 
     
    304308    } 
    305309 
    306     if (!&util::filename_is_absolute($filename)) { 
    307     $filename = &util::filename_cat($ENV{'GSDLCOLLECTDIR'},$filename); 
     310    if (!&FileUtils::isFilenameAbsolute($filename)) { 
     311    $filename = &FileUtils::filenameConcatenate($ENV{'GSDLCOLLECTDIR'},$filename); 
    308312    } 
    309313 
     
    367371    my $osexe = &util::get_os_exe(); 
    368372 
    369     my $hashfile_exe = &util::filename_cat($ENV{'GSDLHOME'},"bin", 
     373    my $hashfile_exe = &FileUtils::filenameConcatenate($ENV{'GSDLHOME'},"bin", 
    370374                       $ENV{'GSDLOS'},"hashfile$osexe"); 
    371375 
  • main/trunk/greenstone2/perllib/gsprintf.pm

    r25499 r27306  
    3232use unicode; 
    3333use util; 
     34use FileUtils; 
    3435 
    3536@gsprintf::EXPORT_OK = qw(gsprintf); # functions we can export into namespace 
     
    236237 
    237238    my $primary_resourcebundlefile  
    238     = &util::filename_cat($bundle_base,$primary_dir,$resourcename); 
     239    = &FileUtils::filenameConcatenate($bundle_base,$primary_dir,$resourcename); 
    239240 
    240241    my $resourcebundle = read_resource_bundle($primary_resourcebundlefile); 
     
    245246    foreach my $e (@extensions) {    
    246247        my $ext_base 
    247         = &util::filename_cat($bundle_base,"ext",$e); 
     248        = &FileUtils::filenameConcatenate($bundle_base,"ext",$e); 
    248249         
    249250        my $ext_resourcebundlefile  
    250         = &util::filename_cat($ext_base,$primary_dir,$resourcename); 
     251        = &FileUtils::filenameConcatenate($ext_base,$primary_dir,$resourcename); 
    251252         
    252253        # can ignore return value (will be same reference to $resourcebundle) 
     
    258259    foreach my $e (@extensions) {    
    259260        my $ext_base 
    260         = &util::filename_cat($ENV{'GSDL3SRCHOME'},"ext",$e); 
     261        = &FileUtils::filenameConcatenate($ENV{'GSDL3SRCHOME'},"ext",$e); 
    261262         
    262263        my $ext_resourcebundlefile  
    263         = &util::filename_cat($ext_base,$primary_dir,$resourcename); 
     264        = &FileUtils::filenameConcatenate($ext_base,$primary_dir,$resourcename); 
    264265         
    265266        # can ignore return value (will be same reference to $resourcebundle) 
  • main/trunk/greenstone2/perllib/mgppbuilder.pm

    r24460 r27306  
    3131use strict; no strict 'refs'; 
    3232use util; 
     33use FileUtils; 
    3334 
    3435 
     
    171172    my $exedir = "$ENV{'GSDLHOME'}/bin/$ENV{'GSDLOS'}"; 
    172173    my $exe = &util::get_os_exe (); 
    173     my $mgpp_passes_exe = &util::filename_cat($exedir, "mgpp_passes$exe"); 
    174     my $mgpp_compression_dict_exe = &util::filename_cat($exedir, "mgpp_compression_dict$exe"); 
     174    my $mgpp_passes_exe = &FileUtils::filenameConcatenate($exedir, "mgpp_passes$exe"); 
     175    my $mgpp_compression_dict_exe = &FileUtils::filenameConcatenate($exedir, "mgpp_compression_dict$exe"); 
    175176    my $outhandle = $self->{'outhandle'}; 
    176177 
    177178    my $maxnumeric = $self->{'maxnumeric'}; 
    178179     
    179     &util::mk_all_dir (&util::filename_cat($self->{'build_dir'}, "text")); 
     180    &FileUtils::makeAllDirectories (&FileUtils::filenameConcatenate($self->{'build_dir'}, "text")); 
    180181 
    181182    my $collect_tail = &util::get_dirsep_tail($self->{'collection'}); 
    182     my $basefilename = &util::filename_cat("text",$collect_tail); 
    183     my $fulltextprefix = &util::filename_cat ($self->{'build_dir'}, $basefilename); 
     183    my $basefilename = &FileUtils::filenameConcatenate("text",$collect_tail); 
     184    my $fulltextprefix = &FileUtils::filenameConcatenate($self->{'build_dir'}, $basefilename); 
    184185     
    185186    my $osextra = ""; 
     
    384385    # get the full index directory path and make sure it exists 
    385386    my $indexdir = $self->{'index_mapping'}->{$index}; 
    386     &util::mk_all_dir (&util::filename_cat($self->{'build_dir'}, $indexdir)); 
     387    &FileUtils::makeAllDirectories (&FileUtils::filenameConcatenate($self->{'build_dir'}, $indexdir)); 
    387388 
    388389    my $collect_tail = &util::get_dirsep_tail($self->{'collection'}); 
    389     my $fullindexprefix = &util::filename_cat ($self->{'build_dir'},  
     390    my $fullindexprefix = &FileUtils::filenameConcatenate($self->{'build_dir'},  
    390391                           $indexdir,  
    391392                           $collect_tail); 
    392     my $fulltextprefix = &util::filename_cat ($self->{'build_dir'}, "text",  
     393    my $fulltextprefix = &FileUtils::filenameConcatenate($self->{'build_dir'}, "text",  
    393394                           $collect_tail); 
    394395 
     
    397398 
    398399    my $exe = &util::get_os_exe (); 
    399     my $mgpp_passes_exe = &util::filename_cat($exedir, "mgpp_passes$exe"); 
     400    my $mgpp_passes_exe = &FileUtils::filenameConcatenate($exedir, "mgpp_passes$exe"); 
    400401 
    401402    # define the section names for mgpasses 
     
    406407 
    407408    my $mgpp_perf_hash_build_exe =  
    408     &util::filename_cat($exedir, "mgpp_perf_hash_build$exe"); 
     409    &FileUtils::filenameConcatenate($exedir, "mgpp_perf_hash_build$exe"); 
    409410    my $mgpp_weights_build_exe =  
    410     &util::filename_cat ($exedir, "mgpp_weights_build$exe"); 
     411    &FileUtils::filenameConcatenate($exedir, "mgpp_weights_build$exe"); 
    411412    my $mgpp_invf_dict_exe =  
    412     &util::filename_cat ($exedir, "mgpp_invf_dict$exe"); 
     413    &FileUtils::filenameConcatenate($exedir, "mgpp_invf_dict$exe"); 
    413414    my $mgpp_stem_idx_exe = 
    414     &util::filename_cat ($exedir, "mgpp_stem_idx$exe"); 
     415    &FileUtils::filenameConcatenate($exedir, "mgpp_stem_idx$exe"); 
    415416 
    416417    my $maxnumeric = $self->{'maxnumeric'}; 
     
    595596 
    596597    # remove unwanted files 
    597     my $tmpdir = &util::filename_cat ($self->{'build_dir'}, $indexdir); 
     598    my $tmpdir = &FileUtils::filenameConcatenate($self->{'build_dir'}, $indexdir); 
    598599    opendir (DIR, $tmpdir) || die 
    599600        "mgppbuilder::build_index - couldn't read directory $tmpdir\n"; 
     
    604605        # delete it! 
    605606        print $outhandle "deleting $file\n" if $self->{'verbosity'} > 2; 
    606         #&util::rm (&util::filename_cat ($tmpdir, $file)); 
     607        #&util::rm (&FileUtils::filenameConcatenate($tmpdir, $file)); 
    607608        } 
    608609    } 
  • main/trunk/greenstone2/perllib/plugins/ArchivesInfPlugin.pm

    r24351 r27306  
    3131 
    3232use util; 
     33use FileUtils; 
    3334use doc; 
    3435use PrintInfo; 
     
    120121        my $base_dir =$self->{'base_dir'}; 
    121122 
    122         my $doc_filename = &util::filename_cat($base_dir,$doc_file); 
     123        my $doc_filename = &FileUtils::filenameConcatenate($base_dir,$doc_file); 
    123124 
    124125        my ($doc_tailname, $doc_dirname, $suffix)  
     
    229230     
    230231    # see if this has a archives information file within it 
    231 ##    my $archive_info_filename = &util::filename_cat($base_dir,$file,"archives.inf"); 
    232     my $archive_info_filename = &dbutil::get_infodb_file_path($infodbtype, "archiveinf-doc", &util::filename_cat($base_dir, $file)); 
     232##    my $archive_info_filename = &FileUtils::filenameConcatenate($base_dir,$file,"archives.inf"); 
     233    my $archive_info_filename = &dbutil::get_infodb_file_path($infodbtype, "archiveinf-doc", &FileUtils::filenameConcatenate($base_dir, $file)); 
    233234 
    234235    if (-e $archive_info_filename) { 
     
    254255        last if ($maxdocs != -1 && ($total_count + $count) >= $maxdocs); 
    255256 
    256         my $tmp = &util::filename_cat ($file, $subfile->[0]); 
     257        my $tmp = &FileUtils::filenameConcatenate($file, $subfile->[0]); 
    257258        next if $tmp eq $file; 
    258259 
  • main/trunk/greenstone2/perllib/plugins/BasePlugin.pm

    r26893 r27306  
    3939use ghtml; 
    4040use gsprintf 'gsprintf'; 
     41use util; 
     42use FileUtils; 
    4143 
    4244use PrintInfo; 
     
    447449    return if $coverfile eq $filename; 
    448450     
    449     if (!&util::fd_exists($coverfile)) { 
     451    if (!&FileUtils::fileExists($coverfile)) { 
    450452        $coverfile =~ s/jpg$/JPG/; 
    451453    }    
    452     if (&util::fd_exists($coverfile)) { 
     454    if (&FileUtils::fileExists($coverfile)) { 
    453455        &util::block_filename($block_hash,$coverfile); 
    454456    }  
     
    14181420    my $top_section=$doc_obj->get_top_section(); 
    14191421 
    1420     if (&util::fd_exists($upgraded_filename)) { 
     1422    if (&FileUtils::fileExists($upgraded_filename)) { 
    14211423    $doc_obj->associate_source_file($filename); 
    14221424        $doc_obj->associate_file($filename, "cover.jpg", "image/jpeg"); 
     
    14291431    $upgraded_upper_filename =~ s/jpg$/JPG/; 
    14301432 
    1431     if (&util::fd_exists($upgraded_upper_filename)) { 
     1433    if (&FileUtils::fileExists($upgraded_upper_filename)) { 
    14321434        $doc_obj->associate_source_file($upper_filename); 
    14331435        $doc_obj->associate_file($upper_filename, "cover.jpg", 
  • main/trunk/greenstone2/perllib/plugins/DirectoryPlugin.pm

    r26867 r27306  
    3434use plugin; 
    3535use util; 
     36use FileUtils; 
    3637use metadatautil; 
    3738 
     
    294295    # that it is not explicitly blocked. 
    295296    my $dirname = $file; 
    296     $dirname = &util::filename_cat ($base_dir, $file) if $base_dir =~ /\w/; 
     297    $dirname = &FileUtils::filenameConcatenate($base_dir, $file) if $base_dir =~ /\w/; 
    297298 
    298299    my $directory_ok = $self->check_directory_path($dirname); 
     
    329330 
    330331    my $this_file_base_dir = $base_dir; 
    331     my $raw_file_subfile = &util::filename_cat($file, $raw_subfile); 
     332    my $raw_file_subfile = &FileUtils::filenameConcatenate($file, $raw_subfile); 
    332333 
    333334    # Recursively read each $raw_subfile 
     
    381382    } else { 
    382383    $dirname = $file; 
    383     $dirname = &util::filename_cat ($base_dir, $file) if $base_dir =~ /\w/; 
     384    $dirname = &FileUtils::filenameConcatenate($base_dir, $file) if $base_dir =~ /\w/; 
    384385    } 
    385386     
     
    412413    # Re-order the files in the list so any directories ending with .all are moved to the end 
    413414    for (my $i = scalar(@dir) - 1; $i >= 0; $i--) { 
    414     if (-d &util::filename_cat($dirname, $dir[$i]) && $dir[$i] =~ /\.all$/) { 
     415    if (-d &FileUtils::filenameConcatenate($dirname, $dir[$i]) && $dir[$i] =~ /\.all$/) { 
    415416        push(@dir, splice(@dir, $i, 1)); 
    416417    } 
     
    461462    my $raw_subfile = &unicode::url_encoded_to_raw_filename($subfile); 
    462463 
    463     my $raw_file_subfile = &util::filename_cat($file, $raw_subfile); 
    464     my $raw_full_filename = &util::filename_cat($this_file_base_dir, $raw_file_subfile); 
     464    my $raw_file_subfile = &FileUtils::filenameConcatenate($file, $raw_subfile); 
     465    my $raw_full_filename = &FileUtils::filenameConcatenate($this_file_base_dir, $raw_file_subfile); 
    465466 
    466467    if ($self->file_is_blocked($block_hash,$raw_full_filename)) { 
     
    542543    my $raw_subfile = &unicode::url_encoded_to_raw_filename($subfile); 
    543544 
    544     my $raw_file_subfile = &util::filename_cat($file, $raw_subfile); 
     545    my $raw_file_subfile = &FileUtils::filenameConcatenate($file, $raw_subfile); 
    545546    my $raw_full_filename  
    546         = &util::filename_cat($this_file_base_dir,$raw_file_subfile); 
     547        = &FileUtils::filenameConcatenate($this_file_base_dir,$raw_file_subfile); 
    547548 
    548549    if ($self->file_is_blocked($block_hash,$raw_full_filename)) { 
     
    554555    if ($raw_subfile =~ /(?i)\.lnk$/ && $ENV{'GSDLOS'} =~ /^windows$/i) { 
    555556        require Win32::Shortcut; 
    556         my $shortcut = new Win32::Shortcut(&util::filename_cat($dirname, $raw_subfile)); 
     557        my $shortcut = new Win32::Shortcut(&FileUtils::filenameConcatenate($dirname, $raw_subfile)); 
    557558        if ($shortcut) { 
    558559        # The file to be processed is now the target of the shortcut 
  • main/trunk/greenstone2/perllib/plugins/GreenstoneXMLPlugin.pm

    r23753 r27306  
    3636 
    3737use ReadXMLFile; 
     38use util; 
     39use FileUtils; 
    3840 
    3941use strict; 
     
    118120 
    119121        my $dirname = dirname($filename_full_path); 
    120         my $full_gsdl_assoc_filename = &util::filename_cat($dirname,$gsdl_assoc_file); 
     122        my $full_gsdl_assoc_filename = &FileUtils::filenameConcatenate($dirname,$gsdl_assoc_file); 
    121123        if ($self->{'verbosity'}>2) { 
    122124            print $outhandle "  Storing block list item: $full_gsdl_assoc_filename\n"; 
     
    316318          { 
    317319            # And if not, append it so as to make this absolute 
    318             $assoc_filepath = &util::filename_cat($self->{'base_dir'}, $assoc_filepath); 
     320            $assoc_filepath = &FileUtils::filenameConcatenate($self->{'base_dir'}, $assoc_filepath); 
    319321          } 
    320322      } 
     
    331333        #rint STDERR "mime_type: $mime_type\n"; 
    332334        #rint STDERR "dir: $dir\n"; 
    333     my $real_dir = &util::filename_cat($assoc_filepath, $assoc_file), 
     335    my $real_dir = &FileUtils::filenameConcatenate($assoc_filepath, $assoc_file), 
    334336    my $assoc_dir = (defined $dir && $dir ne "")  
    335         ? &util::filename_cat($dir, $assoc_file) : $assoc_file; 
     337        ? &FileUtils::filenameConcatenate($dir, $assoc_file) : $assoc_file; 
    336338    $self->{'doc_obj'}->associate_file($real_dir, $assoc_dir, $mime_type); 
    337339        #rint STDERR "According to me the real assoc_filepath is: $real_dir\n"; 
  • main/trunk/greenstone2/perllib/plugins/HTMLPlugin.pm

    r25673 r27306  
    4444use unicode; 
    4545use util; 
     46use FileUtils; 
    4647use XMLParser; 
    4748 
     
    229230        # Turn relative file path into full path 
    230231        my $dirname = &File::Basename::dirname($filename_full_path); 
    231         $raw_link = &util::filename_cat($dirname, $raw_link); 
     232        $raw_link = &FileUtils::filenameConcatenate($dirname, $raw_link); 
    232233    } 
    233234    $raw_link = $self->eval_dir_dots($raw_link); 
     
    336337     
    337338    # set the file to be tidied 
    338     $input_filename = &util::filename_cat($base_dir,$file) if $base_dir =~ m/\w/; 
     339    $input_filename = &FileUtils::filenameConcatenate($base_dir,$file) if $base_dir =~ m/\w/; 
    339340     
    340341    # get the tidied file 
     
    386387    } 
    387388 
    388     my $filename = &util::filename_cat($base_dir,$file); 
     389    my $filename = &FileUtils::filenameConcatenate($base_dir,$file); 
    389390    my $upgraded_base_dir = &util::upgrade_if_dos_filename($base_dir); 
    390391    my $upgraded_filename = &util::upgrade_if_dos_filename($filename); 
     
    709710    if(scalar(@styleTagsText) > 0) 
    710711    { 
    711         my $css_filename_dirname = &File::Basename::dirname(&util::filename_cat($base_dir, $file)); 
     712        my $css_filename_dirname = &File::Basename::dirname(&FileUtils::filenameConcatenate($base_dir, $file)); 
    712713        foreach my $styleText (@styleTagsText) 
    713714        { 
     
    823824        my $directory = &File::Basename::dirname($file); 
    824825         
    825         my $css_filename = &util::filename_cat($base_dir, $directory, $actual_link);     
     826        my $css_filename = &FileUtils::filenameConcatenate($base_dir, $directory, $actual_link);     
    826827        $self->retrieve_css_associated_files($css_filename); 
    827828    } 
     
    943944        $img_url =~ s/^\s*"?([^"]*)"?\s*$/$1/; 
    944945 
    945         $self->{'css_assoc_files'}->{&util::filename_cat($css_filename_dirname, $img_url)} = $img_url; 
     946        $self->{'css_assoc_files'}->{&FileUtils::filenameConcatenate($css_filename_dirname, $img_url)} = $img_url; 
    946947    } 
    947948} 
     
    980981    } 
    981982 
    982     $filename = &util::filename_cat($base_dir, $filename); 
     983    $filename = &FileUtils::filenameConcatenate($base_dir, $filename); 
    983984 
    984985    if (($self->{'use_realistic_book'}) || ($self->{'old_style_HDL'})) { 
     
    10351036    # some special processing if the intended filename was converted to utf8, but 
    10361037    # the actual file still needs to be renamed 
    1037     if (!&util::fd_exists($filename)) { 
     1038    #if (!&util::fd_exists($filename)) { 
     1039    if (!&FileUtils::fileExists($filename)) { 
    10381040    # try the original filename stored in map 
    10391041    if ((defined $ENV{"DEBUG_UNICODE"}) && ($ENV{"DEBUG_UNICODE"})) { 
     
    11311133        # Turn url (using /) into file name (possibly using \ on windows) 
    11321134        my @http_dir_split = split('/', $before_hash); 
    1133         $before_hash = &util::filename_cat(@http_dir_split); 
     1135        $before_hash = &FileUtils::filenameConcatenate(@http_dir_split); 
    11341136    } 
    11351137 
    11361138    $before_hash = $self->eval_dir_dots($before_hash); 
    11371139     
    1138     my $linkfilename = &util::filename_cat ($base_dir, $before_hash); 
     1140    my $linkfilename = &FileUtils::filenameConcatenate($base_dir, $before_hash); 
    11391141     
    11401142    my $rl = 0; 
     
    11581160        my @dirs = split /[\/\\]/, $file; 
    11591161        my $domname = shift (@dirs); 
    1160         $before_hash = &util::filename_cat($domname, $before_hash); 
     1162        $before_hash = &FileUtils::filenameConcatenate($domname, $before_hash); 
    11611163        $before_hash =~ s@\\@/@g; # for windows 
    11621164        } 
     
    11811183            $before_hash = "/$before_hash";  
    11821184 
    1183             $before_hash = &util::filename_cat("",$before_hash); 
     1185            $before_hash = &FileUtils::filenameConcatenate("",$before_hash); 
    11841186            $before_hash =~ s@^$base_dir/@@; 
    11851187        } 
     
    11881190        # Turn relative file path into full path 
    11891191        my $dirname = &File::Basename::dirname($file); 
    1190         $before_hash = &util::filename_cat($dirname, $before_hash); 
     1192        $before_hash = &FileUtils::filenameConcatenate($dirname, $before_hash); 
    11911193        $before_hash = $self->eval_dir_dots($before_hash);               
    11921194    } 
    11931195 
    1194     my $linkfilename = &util::filename_cat ($base_dir, $before_hash);  
     1196    my $linkfilename = &FileUtils::filenameConcatenate($base_dir, $before_hash);  
    11951197 
    11961198 
     
    14621464    # Need to fiddle with number of elements in @eval_dirs if the 
    14631465    # first one is the empty string.  This is because of a 
    1464     # modification to util::filename_cat that supresses the addition 
     1466    # modification to FileUtils::filenameConcatenate that supresses the addition 
    14651467    # of a leading '/' character (or \ if windows) (intended to help 
    14661468    # filename cat with relative paths) if the first entry in the 
     
    14741476    } 
    14751477     
    1476     my $evaluated_filename = (scalar @eval_dirs > 0) ? &util::filename_cat(@eval_dirs) : ""; 
     1478    my $evaluated_filename = (scalar @eval_dirs > 0) ? &FileUtils::filenameConcatenate(@eval_dirs) : ""; 
    14771479    return $evaluated_filename; 
    14781480} 
     
    17561758     
    17571759    # softlink to collection tmp dir 
    1758     my $tmp_dirname = &util::filename_cat($ENV{'GSDLCOLLECTDIR'}, "tidytmp"); 
     1760    my $tmp_dirname = &FileUtils::filenameConcatenate($ENV{'GSDLCOLLECTDIR'}, "tidytmp"); 
    17591761    &util::mk_dir($tmp_dirname) if (!-e $tmp_dirname); 
    17601762     
     
    17711773    { 
    17721774        my $folderdirname = $`; 
    1773         $tmp_dirname = &util::filename_cat($tmp_dirname,$folderdirname); 
     1775        $tmp_dirname = &FileUtils::filenameConcatenate($tmp_dirname,$folderdirname); 
    17741776        &util::mk_dir($tmp_dirname) if (!-e $tmp_dirname); 
    17751777        $test_dirname = $'; #' 
     
    17771779    } 
    17781780     
    1779     my $tmp_filename = &util::filename_cat($tmp_dirname, "$tailname$suffix"); 
     1781    my $tmp_filename = &FileUtils::filenameConcatenate($tmp_dirname, "$tailname$suffix"); 
    17801782     
    17811783    # tidy or convert the input file if it is a HTML-like file or it is accepted by the process_exp 
     
    17861788        if ($self->{'old_style_HDL'}) 
    17871789        { 
    1788         $hdl_output_filename = &util::filename_cat($tmp_dirname, "$tailname$suffix"); 
     1790        $hdl_output_filename = &FileUtils::filenameConcatenate($tmp_dirname, "$tailname$suffix"); 
    17891791        $hdl_output_filename = $self->convert_to_newHDLformat($input_filename,$hdl_output_filename); 
    17901792        } 
     
    17971799    foreach my $file (@files)  
    17981800    { 
    1799         my $src_file = &util::filename_cat($base_dirname,$file); 
    1800         my $dest_file = &util::filename_cat($tmp_dirname,$file); 
     1801        my $src_file = &FileUtils::filenameConcatenate($base_dirname,$file); 
     1802        my $dest_file = &FileUtils::filenameConcatenate($tmp_dirname,$file); 
    18011803        if ((!-e $dest_file) && (!-d $src_file)) 
    18021804        { 
     
    18101812    if ($self->{'use_realistic_book'}) 
    18111813    { 
    1812         $tidy_output_filename = &util::filename_cat($tmp_dirname, "$tailname$suffix"); 
     1814        $tidy_output_filename = &FileUtils::filenameConcatenate($tmp_dirname, "$tailname$suffix"); 
    18131815        $tidy_output_filename = $self->tmp_tidy_file($hdl_output_filename,$tidy_output_filename); 
    18141816    } 
     
    18581860 
    18591861        # get the full path to the image 
    1860         my $img_file = &util::filename_cat($dirname,$attr->{src}); 
     1862        my $img_file = &FileUtils::filenameConcatenate($dirname,$attr->{src}); 
    18611863         
    18621864        # set the width and height attribute 
  • main/trunk/greenstone2/perllib/plugins/MetadataXMLPlugin.pm

    r25094 r27306  
    9595use extrametautil; 
    9696use util; 
     97use FileUtils; 
    9798use metadatautil; 
    9899 
     
    216217    my ($pluginfo, $base_dir, $file, $block_hash, $metadata, $gli) = @_; 
    217218     
    218     my $filename_full_path = &util::filename_cat($base_dir, $file); 
     219    my $filename_full_path = &FileUtils::filenameConcatenate($base_dir, $file); 
    219220    return undef unless $self->can_process_this_file($filename_full_path);     
    220221 
     
    244245    $processor, $gli, $aux) = @_; 
    245246 
    246     my $filename = &util::filename_cat($base_dir, $file); 
     247    my $filename = &FileUtils::filenameConcatenate($base_dir, $file); 
    247248    return undef unless $self->can_process_this_file($filename);     
    248249     
  • main/trunk/greenstone2/perllib/plugout.pm

    r14929 r27306  
    3131 
    3232require util; 
     33use FileUtils; 
    3334use gsprintf 'gsprintf'; 
    3435 
     
    4445my ($verbosity, $outhandle, $failhandle, $globaloptions); 
    4546 
     47# - significantly rewritten to support plugouts in extensions [jmt12] 
    4648sub load_plugout{ 
    4749    my ($plugout) = shift @_; 
     50    my $plugout_name = shift @$plugout; 
     51    my $plugout_suffix = &FileUtils::filenameConcatenate('perllib', 'plugouts', $plugout_name . '.pm'); 
     52    my $plugout_found = 0; 
    4853 
    49     my $colplugdir = &util::filename_cat($ENV{'GSDLCOLLECTDIR'},"perllib/plugouts"); 
    50     unshift (@INC, $colplugdir);  
    51      
    52     my $plugoutname = shift @$plugout; 
     54    # add collection plugout directory to INC unless it is already there 
     55    my $colplugdir = &FileUtils::filenameConcatenate($ENV{'GSDLCOLLECTDIR'},'perllib','plugouts'); 
     56    if (-d $colplugdir) 
     57    { 
     58      my $found_colplugdir = 0; 
     59      foreach my $path (@INC) 
     60      { 
     61        if ($path eq $colplugdir) 
     62        { 
     63          $found_colplugdir = 1; 
     64          last; 
     65        } 
     66      } 
     67      if (!$found_colplugdir) 
     68      { 
     69        unshift (@INC, $colplugdir); 
     70      } 
     71    } 
    5372 
    54     # find the plugout 
    55     my $customplugname; 
     73    # To find the plugout we check a number of possible locations 
     74    # - any plugout found in the collection itself is our first choice, with 
     75    #   those located in 'custom' having precedence 
    5676    if (defined($ENV{'GSDLCOLLECTION'})) 
    5777    { 
    58         $customplugname = &util::filename_cat($ENV{'GSDLCOLLECTDIR'}, "custom", $ENV{'GSDLCOLLECTION'},  
    59                          'perllib', 'plugouts', "${plugoutname}.pm"); 
     78      my $collect_dir = $ENV{'GSDLCOLLECTION'}; 
     79 
     80      # (needed for Veridian?) 
     81      my $custom_plugout = &FileUtils::filenameConcatenate($collect_dir, "custom", $collect_dir, $plugout_suffix); 
     82      if (&FileUtils::fileExists($custom_plugout)) 
     83      { 
     84        require $custom_plugout; 
     85        $plugout_found = 1; 
     86      } 
     87      else 
     88      { 
     89        # typical collection override 
     90        my $collection_plugout = &FileUtils::filenameConcatenate($collect_dir, $plugout_suffix); 
     91        if (&FileUtils::fileExists($collection_plugout)) 
     92        { 
     93          require $custom_plugout; 
     94          $plugout_found = 1; 
     95        } 
     96      } 
     97    } 
     98    # - we then search for overridden version provided by any registered GS3 
     99    #   extensions (check in order of extension definition) 
     100    if (!$plugout_found && defined $ENV{'GSDL3EXTS'}) 
     101    { 
     102      my $ext_prefix = &FileUtils::filenameConcatenate($ENV{'GSDL3SRCHOME'}, "ext"); 
     103      my @extensions = split(/:/,$ENV{'GSDL3EXTS'}); 
     104      foreach my $e (@extensions) 
     105      { 
     106        my $extension_plugout = &FileUtils::filenameConcatenate($ext_prefix, $e, $plugout_suffix); 
     107        if (&FileUtils::fileExists($extension_plugout)) 
     108        { 
     109          require $extension_plugout; 
     110          $plugout_found = 1; 
     111        } 
     112      } 
     113    } 
     114    # - similar for GS2 extensions 
     115    if (!$plugout_found && defined $ENV{'GSDLEXTS'}) 
     116    { 
     117      my $ext_prefix = &FileUtils::filenameConcatenate($ENV{'GSDLHOME'}, "ext"); 
     118      my @extensions = split(/:/,$ENV{'GSDLEXTS'}); 
     119      foreach my $e (@extensions) 
     120      { 
     121        my $extension_plugout = &FileUtils::filenameConcatenate($ext_prefix, $e, $plugout_suffix); 
     122        if (&FileUtils::fileExists($extension_plugout)) 
     123        { 
     124          require $extension_plugout; 
     125          $plugout_found = 1; 
     126        } 
     127      } 
     128    } 
     129    # - and the default is the main Greenstone version of the plugout 
     130    if (!$plugout_found) 
     131    { 
     132      my $main_plugout = &FileUtils::filenameConcatenate($ENV{'GSDLHOME'}, $plugout_suffix); 
     133      if (&FileUtils::fileExists($main_plugout)) 
     134      { 
     135        require $main_plugout; 
     136        $plugout_found = 1; 
     137      } 
    60138    } 
    61139 
    62     my $colplugname = &util::filename_cat($ENV{'GSDLCOLLECTDIR'}, 'perllib', 'plugouts',  
    63                       "${plugoutname}.pm"); 
    64     my $mainplugname = &util::filename_cat($ENV{'GSDLHOME'}, 'perllib', 'plugouts', 
    65                       "${plugoutname}.pm"); 
    66     if (defined($customplugname) && -e $customplugname) { require $customplugname; } 
    67     elsif (-e $colplugname) { require $colplugname; } 
    68     elsif (-e $mainplugname) { require $mainplugname; } 
    69     else { 
    70     gsprintf($outhandle, "{plugout.could_not_find_plugout}\n", 
    71          $plugoutname); 
    72         die "\n"; 
     140    # - no plugout found with this name 
     141    if (!$plugout_found) 
     142    { 
     143      gsprintf($outhandle, "{plugout.could_not_find_plugout}\n", $plugout_name); 
     144      die "\n"; 
    73145    } 
    74146 
    75     # create a plugout object 
     147    # - create a plugout object 
    76148    my ($plugobj); 
    77149 
    78     eval ("\$plugobj = new \$plugoutname([],\$plugout)"); 
     150    eval ("\$plugobj = new \$plugout_name([],\$plugout)"); 
    79151    die "$@" if $@; 
    80152 
  • main/trunk/greenstone2/perllib/plugouts/BasePlugout.pm

    r27071 r27306  
    3636use printusage; 
    3737use parse2; 
    38  
     38use util; 
     39use FileUtils; 
    3940 
    4041# suppress the annoying "subroutine redefined" warning that various 
     
    509510        my $output_dir = $self->get_output_dir(); 
    510511        &util::mk_all_dir ($output_dir) unless -e $output_dir; 
    511         my $doc_file = &util::filename_cat ($output_dir, $doc_dir, "doc.xml"); 
    512         my $short_doc_file = &util::filename_cat ($doc_dir, "doc.xml"); 
     512        my $doc_file = &FileUtils::filenameConcatenate($output_dir, $doc_dir, "doc.xml"); 
     513        my $short_doc_file = &FileUtils::filenameConcatenate($doc_dir, "doc.xml"); 
    513514         
    514515        if ($gs_count>0) 
     
    590591 
    591592    if (!defined $self->{'group'} || !$self->{'group'}){ 
    592     &util::mk_all_dir (&util::filename_cat ($working_dir, $doc_dir)); 
     593    &FileUtils::makeAllDirectories(&FileUtils::filenameConcatenate($working_dir, $doc_dir)); 
    593594    } 
    594595 
     
    619620       } 
    620621   } while ($doc_dir_rest ne "" &&  
    621         ((-d &util::filename_cat ($working_dir, "$doc_dir.dir")) ||  
     622        ((-d &FileUtils::filenameConcatenate($working_dir, "$doc_dir.dir")) ||  
    622623         ($working_info->size() >= 1024 && $doc_dir_num < 2))); 
    623624   my $i = 1; 
    624625   my $doc_dir_base = $doc_dir; 
    625    while (-d &util::filename_cat ($working_dir, "$doc_dir.dir")) { 
     626   while (-d &FileUtils::filenameConcatenate($working_dir, "$doc_dir.dir")) { 
    626627       $doc_dir = "$doc_dir_base-$i"; 
    627628       $i++; 
     
    642643    &util::mk_all_dir ($output_dir) unless -e $output_dir; 
    643644       
    644     my $working_dir = &util::filename_cat($output_dir, $doc_dir); 
     645    my $working_dir = &FileUtils::filenameConcatenate($output_dir, $doc_dir); 
    645646    &util::mk_all_dir ($working_dir) unless -e $working_dir; 
    646647 
     
    662663      
    663664    if ($source_filename !~ /^$dirsep_regexp/) { 
    664         $source_filename = &util::filename_cat($collect_dir, $source_filename); 
     665        $source_filename = &FileUtils::filenameConcatenate($collect_dir, $source_filename); 
    665666    } 
    666667    } 
     
    686687    if (-e $real_filename) { 
    687688 
    688         $filename = &util::filename_cat($working_dir, $afile); 
    689  
    690         &util::hard_link ($real_filename, $filename, $self->{'verbosity'}); 
    691          
     689        $filename = &FileUtils::filenameConcatenate($working_dir, $afile); 
     690 
     691            &FileUtils::hardLink($real_filename, $filename, $self->{'verbosity'}); 
     692 
    692693        $doc_obj->add_utf8_metadata ($doc_obj->get_top_section(), 
    693694                     "gsdlassocfile", 
     
    815816    } 
    816817 
    817     my $rss_filename = &util::filename_cat($output_dir,"rss-items.rdf"); 
     818    my $rss_filename = &FileUtils::filenameConcatenate($output_dir,"rss-items.rdf"); 
    818819    if (open(RSSOUT,">>$rss_filename")) { 
    819820        print RSSOUT "<item>\n"; 
     
    875876    return unless defined $xslt_file and $xslt_file ne "" and -e $xslt_file; 
    876877     
    877     my $java_class_path =  &util::filename_cat ($ENV{'GSDLHOME'},"bin","java","ApplyXSLT.jar"); 
     878    my $java_class_path =  &FileUtils::filenameConcatenate($ENV{'GSDLHOME'},"bin","java","ApplyXSLT.jar"); 
    878879 
    879880    my $mapping_file_path = ""; 
    880881 
    881882    if ($ENV{'GSDLOS'} eq "windows"){ 
    882     $java_class_path .=";".&util::filename_cat ($ENV{'GSDLHOME'},"bin","java","xalan.jar"); 
     883    $java_class_path .=";".&FileUtils::filenameConcatenate($ENV{'GSDLHOME'},"bin","java","xalan.jar"); 
    883884    # this file:/// bit didn't work for me on windows XP 
    884885    #$xslt_file = "\"file:///".$xslt_file."\""; 
     
    886887    } 
    887888    else{ 
    888     $java_class_path .=":".&util::filename_cat ($ENV{'GSDLHOME'},"bin","java","xalan.jar"); 
     889    $java_class_path .=":".&FileUtils::filenameConcatenate($ENV{'GSDLHOME'},"bin","java","xalan.jar"); 
    889890    } 
    890891 
  • main/trunk/greenstone2/perllib/plugouts/GreenstoneXMLPlugout.pm

    r22839 r27306  
    3232eval {require bytes}; 
    3333use util; 
     34use FileUtils; 
    3435use BasePlugout; 
    3536use docprint; 
     
    7273    &util::mk_all_dir ($output_dir) unless -e $output_dir; 
    7374     
    74     my $working_dir = &util::filename_cat ($output_dir, $doc_dir);     
     75    my $working_dir = &FileUtils::filenameConcatenate($output_dir, $doc_dir);     
    7576    &util::mk_all_dir ($working_dir) unless -e $working_dir; 
    7677     
     
    7980    $self->process_metafiles_metadata ($doc_obj); 
    8081 
    81     my $output_file = util::filename_cat ($working_dir, "doc.xml"); 
     82    my $output_file = &FileUtils::filenameConcatenate($working_dir, "doc.xml"); 
    8283     
    8384    $self->open_xslt_pipe($output_file, $self->{'xslt_file'}); 
     
    107108    } 
    108109     
    109     $self->{'short_doc_file'} = util::filename_cat ($doc_dir, "doc.xml");   
     110    $self->{'short_doc_file'} = &FileUtils::filenameConcatenate($doc_dir, "doc.xml");   
    110111     
    111112    $self->store_output_info_reference($doc_obj); 
  • main/trunk/greenstone2/perllib/unicode.pm

    r24193 r27306  
    3636use strict; 
    3737use util; 
     38use FileUtils; 
    3839use MIME::Base64; # for base64 encoding 
    3940 
     
    247248    my $encodename = "$encoding-unicode"; 
    248249    my $enc_info = $encodings::encodings->{$encoding}; 
    249     my $mapfile = &util::filename_cat($ENV{'GSDLHOME'}, "mappings", 
     250    my $mapfile = &FileUtils::filenameConcatenate($ENV{'GSDLHOME'}, "mappings", 
    250251                      "to_uc", $enc_info->{'mapfile'}); 
    251252    if (!&loadmapencoding ($encodename, $mapfile)) { 
     
    499500 
    500501    my $enc_info = $encodings::encodings->{$encoding}; 
    501     my $mapfile = &util::filename_cat($ENV{'GSDLHOME'}, "mappings", 
     502    my $mapfile = &FileUtils::filenameConcatenate($ENV{'GSDLHOME'}, "mappings", 
    502503                      "from_uc", $enc_info->{'mapfile'}); 
    503504    if (!&loadmapencoding ($encodename, $mapfile)) {