- Timestamp:
- 2013-05-30T15:20:33+12:00 (11 years ago)
- Location:
- main/trunk/greenstone2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/bin/script/wvware.pl
r24829 r27519 40 40 use strict; 41 41 use util; 42 use FileUtil; 42 43 43 44 # Are we running on WinNT or Win2000 (or later)? … … 80 81 # my $extdesc = "the GNOME support library extension"; 81 82 82 my $extdir = & util::filename_cat($ENV{'GSDLHOME'},"ext");83 my $gnome_dir = & util::filename_cat($extdir, "gnome-lib-minimal");83 my $extdir = &FileUtils::filenameConcatenate($ENV{'GSDLHOME'},"ext"); 84 my $gnome_dir = &FileUtils::filenameConcatenate($extdir, "gnome-lib-minimal"); 84 85 if(-d $gnome_dir) { 85 86 $ENV{'GEXTGNOME'} = $gnome_dir; 86 87 } else { 87 $gnome_dir = & util::filename_cat($extdir, "gnome-lib");88 $gnome_dir = &FileUtils::filenameConcatenate($extdir, "gnome-lib"); 88 89 if(-d $gnome_dir) { 89 90 $ENV{'GEXTGNOME'} = $gnome_dir; … … 97 98 98 99 if (defined $ENV{'GEXTGNOME'}) { 99 $ENV{'GEXTGNOME_INSTALLED'}=& util::filename_cat($ENV{'GEXTGNOME'}, $ENV{'GSDLOS'});100 $ENV{'GEXTGNOME_INSTALLED'}=&FileUtils::filenameConcatenate($ENV{'GEXTGNOME'}, $ENV{'GSDLOS'}); 100 101 101 &util::envvar_prepend("PATH", & util::filename_cat($ENV{'GEXTGNOME_INSTALLED'}, "bin"));102 &util::envvar_prepend("PATH", &FileUtils::filenameConcatenate($ENV{'GEXTGNOME_INSTALLED'}, "bin")); 102 103 103 104 # util's prepend will create LD/DYLD_LIB_PATH if it doesn't exist yet 104 my $gextlib = & util::filename_cat($ENV{'GEXTGNOME_INSTALLED'}, "lib");105 my $gextlib = &FileUtils::filenameConcatenate($ENV{'GEXTGNOME_INSTALLED'}, "lib"); 105 106 if($ENV{'GSDLOS'} eq "linux") { 106 107 &util::envvar_prepend("LD_LIBRARY_PATH", $gextlib); … … 122 123 # RUN WVWARE 123 124 124 my $wvWare = & util::filename_cat($ENV{'GSDLHOME'}, "bin", $ENV{'GSDLOS'}, "wvWare");125 126 my $wvware_folder = & util::filename_cat($ENV{'GSDLHOME'}, "bin", $ENV{'GSDLOS'}, "wv");125 my $wvWare = &FileUtils::filenameConcatenate($ENV{'GSDLHOME'}, "bin", $ENV{'GSDLOS'}, "wvWare"); 126 127 my $wvware_folder = &FileUtils::filenameConcatenate($ENV{'GSDLHOME'}, "bin", $ENV{'GSDLOS'}, "wv"); 127 128 if ( -d $wvware_folder && $ENV{'GSDLOS'} eq "linux" ) { 128 &util::envvar_prepend("PATH", & util::filename_cat($wvware_folder, "bin"));129 130 my $wvwarelib = & util::filename_cat($wvware_folder, "lib");129 &util::envvar_prepend("PATH", &FileUtils::filenameConcatenate($wvware_folder, "bin")); 130 131 my $wvwarelib = &FileUtils::filenameConcatenate($wvware_folder, "lib"); 131 132 if($ENV{'GSDLOS'} eq "linux") { 132 133 &util::envvar_prepend("LD_LIBRARY_PATH", $wvwarelib); … … 134 135 # &util::envvar_prepend("DYLD_LIBRARY_PATH", $wvwarelib); 135 136 #} 136 $wvWare = & util::filename_cat($wvware_folder, "bin", "wvWare");137 $wvWare = &FileUtils::filenameConcatenate($wvware_folder, "bin", "wvWare"); 137 138 } 138 139 … … 142 143 $wvWare = "wvWare" if ($ENV{'GSDLOS'} =~ m/^windows$/i); 143 144 144 my $wv_conf = & util::filename_cat($ENV{'GSDLHOME'}, "etc",145 my $wv_conf = &FileUtils::filenameConcatenate($ENV{'GSDLHOME'}, "etc", 145 146 "packages", "wv", "wvHtml.xml"); 146 147 … … 185 186 # would generate ($windows_scripting) when it converts from word to html. 186 187 # That is, foldername=docname_files 187 my $assoc_dir = & util::filename_cat($toppath, $docname."_files");188 my $assoc_dir = &FileUtils::filenameConcatenate($toppath, $docname."_files"); 188 189 #print "assoc_dir: ".$assoc_dir."\n"; # same as "$output_filestem._files" 189 190 … … 191 192 # if it exists already, just delete and recreate 192 193 if(-e $assoc_dir) { 193 & util::rm_r($assoc_dir);194 &FileUtils::removeFilesRecursive($assoc_dir); 194 195 } 195 & util::mk_dir($assoc_dir);196 &FileUtils::makeDirectory($assoc_dir); 196 197 197 198 # the images are all going to be called image0, image1,..., imageN 198 my $img_basenames = & util::filename_cat($assoc_dir, $docname);199 my $img_basenames = &FileUtils::filenameConcatenate($assoc_dir, $docname); 199 200 200 201 #print STDERR "****toppath: $toppath\n****docname: $docname\n; … … 254 255 close(TMP); 255 256 if ($line && $line =~ m/DOCTYPE HTML/) { 256 & util::rm("$output_filestem.err") if -e "$output_filestem.err";257 &FileUtils::removeFiles("$output_filestem.err") if -e "$output_filestem.err"; 257 258 258 259 # Inserted this code to remove the images directory if it was still empty after 259 260 # the html was generated (in case there were no images in the word document) 260 if (& util::is_dir_empty($assoc_dir)) {261 if (&FileUtils::isDirectoryEmpty($assoc_dir)) { 261 262 #print STDERR "***gsConvert.pl: Image dir $assoc_dir is empty, removing***\n"; 262 & util::rm_r($assoc_dir);263 &FileUtils::removeFilesRecursive($assoc_dir); 263 264 } else { # there was an image folder (it was generated) 264 265 # Therefore, the html file generated contains absolute links to the images … … 271 272 272 273 # If here, an error of some sort occurred 273 & util::rm("$output_filestem.html") if -e "$output_filestem.html";274 &FileUtils::removeFiles("$output_filestem.html") if -e "$output_filestem.html"; 274 275 if (-e "$output_filestem.err") { 275 276 if ($faillogfile ne "" && defined(open(FAILLOG,">>$faillogfile"))) { … … 279 280 close ERRLOG; 280 281 } 281 & util::rm("$output_filestem.err");282 &FileUtils::removeFiles("$output_filestem.err"); 282 283 } 283 284 … … 362 363 # delete the original file and recreate it 363 364 my $copy_of_filename = $html_file; 364 & util::rm($copy_of_filename); # deleted the file365 &FileUtils::removeFiles($copy_of_filename); # deleted the file 365 366 366 367 # Recreate the original file for writing the updated contents -
main/trunk/greenstone2/perllib/plugins/ImageConverter.pm
r27354 r27519 33 33 34 34 use util; 35 use FileUtils; 35 36 use gsprintf 'gsprintf'; 36 37 … … 232 233 # check the size of the image against minimum size if specified 233 234 my $minimumsize = $self->{'minimumsize'}; 234 if (defined $minimumsize && ( -s $filename_full_path< $minimumsize)) {235 if (defined $minimumsize && (&FileUtils::fileSize($filename_full_path) < $minimumsize)) { 235 236 print $outhandle "ImageConverter: \"$filename_full_path\" too small, skipping\n" 236 237 if ($verbosity > 1); … … 319 320 #overwrite the ones added in BasePlugin 320 321 $doc_obj->set_metadata_element ($section, "FileFormat", $type); 321 my $sys_file_size = -s $filename_full_path;322 my $sys_file_size = &FileUtils::fileSize($filename_full_path); 322 323 $doc_obj->set_metadata_element ($section, "FileSize", $sys_file_size); #$image_size); 323 324
Note:
See TracChangeset
for help on using the changeset viewer.