Index: main/trunk/greenstone2/perllib/plugins/HTMLPlugin.pm
===================================================================
--- main/trunk/greenstone2/perllib/plugins/HTMLPlugin.pm	(revision 25673)
+++ main/trunk/greenstone2/perllib/plugins/HTMLPlugin.pm	(revision 27306)
@@ -44,4 +44,5 @@
 use unicode;
 use util;
+use FileUtils;
 use XMLParser;
 
@@ -229,5 +230,5 @@
 	    # Turn relative file path into full path
 	    my $dirname = &File::Basename::dirname($filename_full_path);
-	    $raw_link = &util::filename_cat($dirname, $raw_link);
+	    $raw_link = &FileUtils::filenameConcatenate($dirname, $raw_link);
 	}
 	$raw_link = $self->eval_dir_dots($raw_link);
@@ -336,5 +337,5 @@
 	
 	# set the file to be tidied
-	$input_filename = &util::filename_cat($base_dir,$file) if $base_dir =~ m/\w/;
+	$input_filename = &FileUtils::filenameConcatenate($base_dir,$file) if $base_dir =~ m/\w/;
 	
 	# get the tidied file
@@ -386,5 +387,5 @@
     }
 
-    my $filename = &util::filename_cat($base_dir,$file);
+    my $filename = &FileUtils::filenameConcatenate($base_dir,$file);
     my $upgraded_base_dir = &util::upgrade_if_dos_filename($base_dir);
     my $upgraded_filename = &util::upgrade_if_dos_filename($filename);
@@ -709,5 +710,5 @@
 	if(scalar(@styleTagsText) > 0)
 	{
-		my $css_filename_dirname = &File::Basename::dirname(&util::filename_cat($base_dir, $file));
+		my $css_filename_dirname = &File::Basename::dirname(&FileUtils::filenameConcatenate($base_dir, $file));
 		foreach my $styleText (@styleTagsText)
 		{
@@ -823,5 +824,5 @@
 		my $directory = &File::Basename::dirname($file);
 		
-		my $css_filename = &util::filename_cat($base_dir, $directory, $actual_link);	
+		my $css_filename = &FileUtils::filenameConcatenate($base_dir, $directory, $actual_link);	
 		$self->retrieve_css_associated_files($css_filename);
 	}
@@ -943,5 +944,5 @@
 		$img_url =~ s/^\s*"?([^"]*)"?\s*$/$1/;
 
-		$self->{'css_assoc_files'}->{&util::filename_cat($css_filename_dirname, $img_url)} = $img_url;
+		$self->{'css_assoc_files'}->{&FileUtils::filenameConcatenate($css_filename_dirname, $img_url)} = $img_url;
 	}
 }
@@ -980,5 +981,5 @@
     }
 
-    $filename = &util::filename_cat($base_dir, $filename);
+    $filename = &FileUtils::filenameConcatenate($base_dir, $filename);
 
     if (($self->{'use_realistic_book'}) || ($self->{'old_style_HDL'})) {
@@ -1035,5 +1036,6 @@
     # some special processing if the intended filename was converted to utf8, but
     # the actual file still needs to be renamed
-    if (!&util::fd_exists($filename)) {
+    #if (!&util::fd_exists($filename)) {
+    if (!&FileUtils::fileExists($filename)) {
 	# try the original filename stored in map
 	if ((defined $ENV{"DEBUG_UNICODE"}) && ($ENV{"DEBUG_UNICODE"})) {
@@ -1131,10 +1133,10 @@
 	    # Turn url (using /) into file name (possibly using \ on windows)
 	    my @http_dir_split = split('/', $before_hash);
-	    $before_hash = &util::filename_cat(@http_dir_split);
+	    $before_hash = &FileUtils::filenameConcatenate(@http_dir_split);
 	}
 
 	$before_hash = $self->eval_dir_dots($before_hash);
 	
-	my $linkfilename = &util::filename_cat ($base_dir, $before_hash);
+	my $linkfilename = &FileUtils::filenameConcatenate($base_dir, $before_hash);
 	
 	my $rl = 0;
@@ -1158,5 +1160,5 @@
 		my @dirs = split /[\/\\]/, $file;
 		my $domname = shift (@dirs);
-		$before_hash = &util::filename_cat($domname, $before_hash);
+		$before_hash = &FileUtils::filenameConcatenate($domname, $before_hash);
 		$before_hash =~ s@\\@/@g; # for windows
 	    }
@@ -1181,5 +1183,5 @@
 		    $before_hash = "/$before_hash"; 
 
-		    $before_hash = &util::filename_cat("",$before_hash);
+		    $before_hash = &FileUtils::filenameConcatenate("",$before_hash);
 		    $before_hash =~ s@^$base_dir/@@;
 		}
@@ -1188,9 +1190,9 @@
 	    # Turn relative file path into full path
 	    my $dirname = &File::Basename::dirname($file);
-	    $before_hash = &util::filename_cat($dirname, $before_hash);
+	    $before_hash = &FileUtils::filenameConcatenate($dirname, $before_hash);
 	    $before_hash = $self->eval_dir_dots($before_hash);	    	    
 	}
 
-	my $linkfilename = &util::filename_cat ($base_dir, $before_hash); 
+	my $linkfilename = &FileUtils::filenameConcatenate($base_dir, $before_hash); 
 
 
@@ -1462,5 +1464,5 @@
     # Need to fiddle with number of elements in @eval_dirs if the
     # first one is the empty string.  This is because of a
-    # modification to util::filename_cat that supresses the addition
+    # modification to FileUtils::filenameConcatenate that supresses the addition
     # of a leading '/' character (or \ if windows) (intended to help
     # filename cat with relative paths) if the first entry in the
@@ -1474,5 +1476,5 @@
     }
     
-    my $evaluated_filename = (scalar @eval_dirs > 0) ? &util::filename_cat(@eval_dirs) : "";
+    my $evaluated_filename = (scalar @eval_dirs > 0) ? &FileUtils::filenameConcatenate(@eval_dirs) : "";
     return $evaluated_filename;
 }
@@ -1756,5 +1758,5 @@
     
     # softlink to collection tmp dir
-    my $tmp_dirname = &util::filename_cat($ENV{'GSDLCOLLECTDIR'}, "tidytmp");
+    my $tmp_dirname = &FileUtils::filenameConcatenate($ENV{'GSDLCOLLECTDIR'}, "tidytmp");
     &util::mk_dir($tmp_dirname) if (!-e $tmp_dirname);
     
@@ -1771,5 +1773,5 @@
 	{
 	    my $folderdirname = $`;
-	    $tmp_dirname = &util::filename_cat($tmp_dirname,$folderdirname);
+	    $tmp_dirname = &FileUtils::filenameConcatenate($tmp_dirname,$folderdirname);
 	    &util::mk_dir($tmp_dirname) if (!-e $tmp_dirname);
 	    $test_dirname = $'; #'
@@ -1777,5 +1779,5 @@
     }
     
-    my $tmp_filename = &util::filename_cat($tmp_dirname, "$tailname$suffix");
+    my $tmp_filename = &FileUtils::filenameConcatenate($tmp_dirname, "$tailname$suffix");
     
     # tidy or convert the input file if it is a HTML-like file or it is accepted by the process_exp
@@ -1786,5 +1788,5 @@
     	if ($self->{'old_style_HDL'})
     	{
-	    $hdl_output_filename = &util::filename_cat($tmp_dirname, "$tailname$suffix");
+	    $hdl_output_filename = &FileUtils::filenameConcatenate($tmp_dirname, "$tailname$suffix");
 	    $hdl_output_filename = $self->convert_to_newHDLformat($input_filename,$hdl_output_filename);
     	}
@@ -1797,6 +1799,6 @@
 	foreach my $file (@files) 
 	{
-	    my $src_file = &util::filename_cat($base_dirname,$file);
-	    my $dest_file = &util::filename_cat($tmp_dirname,$file);
+	    my $src_file = &FileUtils::filenameConcatenate($base_dirname,$file);
+	    my $dest_file = &FileUtils::filenameConcatenate($tmp_dirname,$file);
 	    if ((!-e $dest_file) && (!-d $src_file))
 	    {
@@ -1810,5 +1812,5 @@
 	if ($self->{'use_realistic_book'})
 	{
-	    $tidy_output_filename = &util::filename_cat($tmp_dirname, "$tailname$suffix");
+	    $tidy_output_filename = &FileUtils::filenameConcatenate($tmp_dirname, "$tailname$suffix");
 	    $tidy_output_filename = $self->tmp_tidy_file($hdl_output_filename,$tidy_output_filename);
 	}
@@ -1858,5 +1860,5 @@
 
 	    # get the full path to the image
-	    my $img_file = &util::filename_cat($dirname,$attr->{src});
+	    my $img_file = &FileUtils::filenameConcatenate($dirname,$attr->{src});
 	    
 	    # set the width and height attribute
