Index: main/trunk/greenstone2/perllib/mgbuilder.pm
===================================================================
--- main/trunk/greenstone2/perllib/mgbuilder.pm	(revision 24404)
+++ main/trunk/greenstone2/perllib/mgbuilder.pm	(revision 27535)
@@ -30,4 +30,5 @@
 use strict; no strict 'refs';
 use util;
+use FileUtils;
 
 
@@ -130,15 +131,15 @@
     my $exedir = "$ENV{'GSDLHOME'}/bin/$ENV{'GSDLOS'}";
     my $exe = &util::get_os_exe ();
-    my $mg_passes_exe = &util::filename_cat($exedir, "mg_passes$exe");
-    my $mg_compression_dict_exe = &util::filename_cat($exedir, "mg_compression_dict$exe");
+    my $mg_passes_exe = &FileUtils::filenameConcatenate($exedir, "mg_passes$exe");
+    my $mg_compression_dict_exe = &FileUtils::filenameConcatenate($exedir, "mg_compression_dict$exe");
     my $outhandle = $self->{'outhandle'};
 
     my $maxnumeric = $self->{'maxnumeric'};
 
-    &util::mk_all_dir (&util::filename_cat($self->{'build_dir'}, "text"));
+    &FileUtils::makeAllDirectories (&FileUtils::filenameConcatenate($self->{'build_dir'}, "text"));
 
     my $collect_tail = &util::get_dirsep_tail($self->{'collection'});
-    my $basefilename = &util::filename_cat("text",$collect_tail);
-    my $fulltextprefix = &util::filename_cat ($self->{'build_dir'}, $basefilename);
+    my $basefilename = &FileUtils::filenameConcatenate("text",$collect_tail);
+    my $fulltextprefix = &FileUtils::filenameConcatenate($self->{'build_dir'}, $basefilename);
 
     my $osextra = "";
@@ -328,10 +329,10 @@
     # get the full index directory path and make sure it exists
     my $indexdir = $self->{'index_mapping'}->{$index};
-    &util::mk_all_dir (&util::filename_cat($self->{'build_dir'}, $indexdir));
+    &FileUtils::makeAllDirectories (&FileUtils::filenameConcatenate($self->{'build_dir'}, $indexdir));
 
     my $collect_tail = &util::get_dirsep_tail($self->{'collection'});
-    my $fullindexprefix = &util::filename_cat ($self->{'build_dir'}, $indexdir, 
+    my $fullindexprefix = &FileUtils::filenameConcatenate($self->{'build_dir'}, $indexdir, 
 					       $collect_tail);
-    my $fulltextprefix = &util::filename_cat ($self->{'build_dir'}, "text", 
+    my $fulltextprefix = &FileUtils::filenameConcatenate($self->{'build_dir'}, "text", 
 					       $collect_tail);
 
@@ -339,13 +340,13 @@
     my $exedir = "$ENV{'GSDLHOME'}/bin/$ENV{'GSDLOS'}";
     my $exe = &util::get_os_exe ();
-    my $mg_passes_exe = &util::filename_cat($exedir, "mg_passes$exe");
+    my $mg_passes_exe = &FileUtils::filenameConcatenate($exedir, "mg_passes$exe");
     my $mg_perf_hash_build_exe = 
-	&util::filename_cat($exedir, "mg_perf_hash_build$exe");
+	&FileUtils::filenameConcatenate($exedir, "mg_perf_hash_build$exe");
     my $mg_weights_build_exe = 
-	&util::filename_cat ($exedir, "mg_weights_build$exe");
+	&FileUtils::filenameConcatenate($exedir, "mg_weights_build$exe");
     my $mg_invf_dict_exe = 
-	&util::filename_cat ($exedir, "mg_invf_dict$exe");
+	&FileUtils::filenameConcatenate($exedir, "mg_invf_dict$exe");
     my $mg_stem_idx_exe =
-	&util::filename_cat ($exedir, "mg_stem_idx$exe");
+	&FileUtils::filenameConcatenate($exedir, "mg_stem_idx$exe");
 
     my $maxnumeric = $self->{'maxnumeric'};
@@ -516,5 +517,5 @@
 
 	# remove unwanted files
-	my $tmpdir = &util::filename_cat ($self->{'build_dir'}, $indexdir);
+	my $tmpdir = &FileUtils::filenameConcatenate($self->{'build_dir'}, $indexdir);
 	opendir (DIR, $tmpdir) || die
 	    "mgbuilder::build_index - couldn't read directory $tmpdir\n";
@@ -525,5 +526,5 @@
 		# delete it!
 		print $outhandle "deleting $file\n" if $self->{'verbosity'} > 2;
-		&util::rm (&util::filename_cat ($tmpdir, $file));
+		&FileUtils::removeFiles (&FileUtils::filenameConcatenate($tmpdir, $file));
 	    }
 	}
@@ -540,8 +541,8 @@
     my $exedir = "$ENV{'GSDLHOME'}/bin/$ENV{'GSDLOS'}";
     my $exe = &util::get_os_exe ();
-    my $mgstat_exe = &util::filename_cat($exedir, "mgstat$exe");
+    my $mgstat_exe = &FileUtils::filenameConcatenate($exedir, "mgstat$exe");
 
     my $collect_tail = &util::get_dirsep_tail($self->{'collection'});
-    my $input_file = &util::filename_cat ("text", $collect_tail);
+    my $input_file = &FileUtils::filenameConcatenate("text", $collect_tail);
     if (!-e "$mgstat_exe" || !open (PIPEIN, "mgstat$exe -d \"$self->{'build_dir'}\" -f \"$input_file\" |")) {
 	my $outhandle = $self->{'outhandle'};
