[vhffs-dev] [1420] Fixed bot failure when /data/listengine does not exists, use File:: Path instead of system

[ Thread Index | Date Index | More vhffs.org/vhffs-dev Archives ]


Revision: 1420
Author:   beuss
Date:     2009-05-29 08:05:10 +0200 (Fri, 29 May 2009)

Log Message:
-----------
Fixed bot failure when /data/listengine does not exists, use File::Path instead of system

Modified Paths:
--------------
    trunk/vhffs-robots/src/listengine_publicarchives.pl


Modified: trunk/vhffs-robots/src/listengine_publicarchives.pl
===================================================================
--- trunk/vhffs-robots/src/listengine_publicarchives.pl	2009-05-28 21:24:14 UTC (rev 1419)
+++ trunk/vhffs-robots/src/listengine_publicarchives.pl	2009-05-29 06:05:10 UTC (rev 1420)
@@ -10,6 +10,7 @@
 use Vhffs::Services::MailingList;
 use Vhffs::Constants;
 use Vhffs::Robots;
+use File::Path;
 use HTML::Template;
 
 my $vhffs = init Vhffs::Main;
@@ -38,7 +39,9 @@
 my $configmhonarc = $miscdir."/mhonarc.config";
 die "mhonarc configuration file unavailable" unless( -f $configmhonarc );
 
-mkdir($outputdir, 0755);
+File::Path::mkpath( $outputdir, {
+	mode => 0755
+});
 die "Cannot create ".$outputdir." directory\n" unless( -d $outputdir );
 
 Vhffs::Robots::lock( $vhffs , "listenginearchives" );
@@ -54,7 +57,7 @@
 	if ( $list->get_open_archive == 0 )  {
 		my $publicdir = $outputdir."/".$list->get_domain."/".$list->get_localpart;
 		if ( -d $publicdir)  {
-			system("rm -rf $publicdir 2>/dev/null");
+			File::Path::rmtree($publicdir);
 		}
 		next;
 	}


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/