[vhffs-dev] [2035] removed Vhffs::Functions::create_dir(), using File::Path::make_path( ) instead

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


Revision: 2035
Author:   gradator
Date:     2012-02-20 22:24:44 +0100 (Mon, 20 Feb 2012)
Log Message:
-----------
removed Vhffs::Functions::create_dir(), using File::Path::make_path() instead

Modified Paths:
--------------
    trunk/vhffs-api/src/Vhffs/Functions.pm
    trunk/vhffs-api/src/Vhffs/Panel/Avatar.pm
    trunk/vhffs-api/src/Vhffs/Robots/Bazaar.pm
    trunk/vhffs-api/src/Vhffs/Robots/Cvs.pm
    trunk/vhffs-api/src/Vhffs/Robots/Git.pm
    trunk/vhffs-api/src/Vhffs/Robots/Group.pm
    trunk/vhffs-api/src/Vhffs/Robots/Mercurial.pm
    trunk/vhffs-api/src/Vhffs/Robots/Repository.pm
    trunk/vhffs-api/src/Vhffs/Robots/Svn.pm
    trunk/vhffs-api/src/Vhffs/Robots/User.pm
    trunk/vhffs-api/src/Vhffs/Robots/Web.pm
    trunk/vhffs-listengine/src/listengine.pl
    trunk/vhffs-robots/src/mail_createboxes.pl
    trunk/vhffs-robots/src/mail_delete.pl
    trunk/vhffs-robots/src/mail_deleteboxes.pl
    trunk/vhffs-robots/src/repository_stats.pl
    trunk/vhffs-robots/src/web_stats.pl

Modified: trunk/vhffs-api/src/Vhffs/Functions.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Functions.pm	2012-02-19 23:55:03 UTC (rev 2034)
+++ trunk/vhffs-api/src/Vhffs/Functions.pm	2012-02-20 21:24:44 UTC (rev 2035)
@@ -52,29 +52,6 @@
 
 srand(time ^ $$);
 
-=head2 create_dir
-
-Vhffs::Functions::create_dir( $dir );
-
-Recursively create a directory. Returns 0 on success, otherwise returns < 0.
-
-=cut
-sub create_dir {
-	my $dir = shift;
-
-	my @subdirs = split( /\//, $dir );
-	@subdirs = reverse @subdirs;
-
-	my $path = '';
-	while( defined(my $value = pop(@subdirs))  ) {
-		$path .= '/'.$value if $value ne '';
-		mkdir( $path ) unless -d $path;
-	}
-
-	return -1 unless -d $dir;
-	return 0;
-}
-
 =head2 send_mail
 
 my $ret = Vhffs::Functions::send_mail( $vhffs, $from, $to, $mailtag, $subject, $message, $precedence );

Modified: trunk/vhffs-api/src/Vhffs/Panel/Avatar.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Avatar.pm	2012-02-19 23:55:03 UTC (rev 2034)
+++ trunk/vhffs-api/src/Vhffs/Panel/Avatar.pm	2012-02-20 21:24:44 UTC (rev 2035)
@@ -31,6 +31,7 @@
 
 use strict;
 use utf8;
+use File::Path;
 
 package Vhffs::Panel::Avatar;
 
@@ -61,7 +62,8 @@
 	my $path = $dir.'/'.$oid;
 #	$path .= ".".$type if( defined $type );
 
-	Vhffs::Functions::create_dir( $dir );
+	# TODO: check make_path
+	File::Path::make_path( $dir );
 
 	open( my $forig, '<', $file ) or return -2;
 	open( my $fcopy, '>', $path ) or return -3;

Modified: trunk/vhffs-api/src/Vhffs/Robots/Bazaar.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Robots/Bazaar.pm	2012-02-19 23:55:03 UTC (rev 2034)
+++ trunk/vhffs-api/src/Vhffs/Robots/Bazaar.pm	2012-02-20 21:24:44 UTC (rev 2035)
@@ -32,6 +32,8 @@
 use strict;
 use utf8;
 use Cwd;
+use File::Path;
+use File::Basename;
 
 package Vhffs::Robots::Bazaar;
 
@@ -54,7 +56,8 @@
 		return -1;
 	}
 
-	Vhffs::Functions::create_dir( $dir );
+	# TODO: check make_path
+	File::Path::make_path( $dir );
 	Vhffs::Robots::chmod_recur( $dir , 0664 , 02775 );
 	Vhffs::Robots::chown_recur( $dir , $bazaar->get_owner_uid , $bazaar->get_owner_gid );
 	$bazaar->add_history('Ok, robots find the empty directory and will create bazaar repository');
@@ -106,8 +109,6 @@
 
 sub delete_repo
 {
-	use File::Path;
-	use File::Basename;
 	my $bazaar = shift;
 	return -1 unless defined $bazaar;
 
@@ -115,6 +116,7 @@
 	my $dir = $bazaar->get_dir;
 	Vhffs::Robots::archive_targz( $bazaar, $dir );
 
+	# TODO: check remove_tree
 	File::Path::remove_tree($dir) if(-d $dir);
 	my $groupdir = File::Basename::dirname($dir);
 	rmdir($groupdir);

Modified: trunk/vhffs-api/src/Vhffs/Robots/Cvs.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Robots/Cvs.pm	2012-02-19 23:55:03 UTC (rev 2034)
+++ trunk/vhffs-api/src/Vhffs/Robots/Cvs.pm	2012-02-20 21:24:44 UTC (rev 2035)
@@ -33,6 +33,8 @@
 
 use strict;
 use utf8;
+use File::Path;
+use File::Basename;
 
 use Vhffs::Services::Cvs;
 use Vhffs::Constants;
@@ -53,7 +55,8 @@
 		return -1;
 	}
 
-	Vhffs::Functions::create_dir( $dir );
+	# TODO: check make_path
+	File::Path::make_path( $dir );
 	Vhffs::Robots::chmod_recur( $dir , 0664 , 02775 );
 	Vhffs::Robots::chown_recur( $dir , $cvs->get_owner_uid , $cvs->get_owner_gid );
 	$cvs->add_history('Ok, robots find the empty directory and will create cvs repository');
@@ -89,14 +92,13 @@
 
 sub delete_cvs
 {
-	use File::Path;
-	use File::Basename;
 	my $cvs = shift;
 	return -1 unless defined $cvs;
 
 	my $dir = $cvs->get_dir;
 	Vhffs::Robots::archive_targz( $cvs, $dir );
 
+	# TODO: check remove_tree
 	File::Path::remove_tree($dir) if(-d $dir);
 	# Remove parent dir if empty (i.e. this group has no move CVSes).
 	my $groupdir = File::Basename::dirname($dir);

Modified: trunk/vhffs-api/src/Vhffs/Robots/Git.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Robots/Git.pm	2012-02-19 23:55:03 UTC (rev 2034)
+++ trunk/vhffs-api/src/Vhffs/Robots/Git.pm	2012-02-20 21:24:44 UTC (rev 2035)
@@ -58,7 +58,8 @@
 		return -1;
 	}
 
-	Vhffs::Functions::create_dir( $dir );
+	# TODO: check make_path
+	File::Path::make_path( $dir );
 	Vhffs::Robots::chmod_recur( $dir , 0664 , 02775 );
 	Vhffs::Robots::chown_recur( $dir , $git->get_owner_uid , $git->get_owner_gid );
 	$git->add_history('Ok, robots find the empty directory and will create git repository');
@@ -156,6 +157,7 @@
 	my $dir = $git->get_dir;
 	Vhffs::Robots::archive_targz( $git, $dir );
 
+	# TODO: check remove_tree
 	File::Path::remove_tree($dir) if(-d $dir);
 	my $groupdir = File::Basename::dirname($dir);
 	rmdir($groupdir);

Modified: trunk/vhffs-api/src/Vhffs/Robots/Group.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Robots/Group.pm	2012-02-19 23:55:03 UTC (rev 2034)
+++ trunk/vhffs-api/src/Vhffs/Robots/Group.pm	2012-02-20 21:24:44 UTC (rev 2035)
@@ -52,13 +52,22 @@
 	my $user = Vhffs::User::get_by_uid( $main , $group->get_owner_uid );
 	my $dir = $group->get_dir;
 	$group->add_history('Ok, Robots is going to create the directory');
-	Vhffs::Functions::create_dir( $dir );
-	chown( $group->get_owner_uid , $group->get_gid , $dir );
-	chmod( 02770 , $dir );
-	$group->add_history('Ok, Robots finished the creation of the directory');
-	add_user( $user , $group , $main );
-	$group->set_status( Vhffs::Constants::ACTIVATED );
-	$group->commit;
+	File::Path::make_path( $dir, { error => \my $errors } );
+	unless( @$errors ) {
+		chown( $group->get_owner_uid , $group->get_gid , $dir );
+		chmod( 02770 , $dir );
+		$group->add_history('Ok, Robots finished the creation of the directory');
+		add_user( $user , $group , $main );
+		$group->set_status( Vhffs::Constants::ACTIVATED );
+		$group->commit;
+	}
+	else {
+		$group->add_history( 'cannot create the group directory' );
+#		$group->set_status( Vhffs::Constants::CREATING_ERROR );
+#		$group->commit;
+		return undef;
+	}
+
 	return $dir;
 }
 
@@ -75,8 +84,7 @@
 	{
 		Vhffs::Robots::archive_targz( $group, $dir );
 
-		my $errors=[];
-		File::Path::remove_tree( $dir, { error => \$errors });
+		File::Path::remove_tree( $dir, { error => \my $errors });
 		# Group directories are hashed on two levels, so we've potentially two empty directories to delete
 		$dir = File::Basename::dirname($dir);
 		rmdir $dir;

Modified: trunk/vhffs-api/src/Vhffs/Robots/Mercurial.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Robots/Mercurial.pm	2012-02-19 23:55:03 UTC (rev 2034)
+++ trunk/vhffs-api/src/Vhffs/Robots/Mercurial.pm	2012-02-20 21:24:44 UTC (rev 2035)
@@ -32,6 +32,8 @@
 use strict;
 use utf8;
 use Cwd;
+use File::Path;
+use File::Basename;
 
 package Vhffs::Robots::Mercurial;
 
@@ -54,7 +56,8 @@
 		return -1;
 	}
 
-	Vhffs::Functions::create_dir( $dir );
+	# TODO: check make_path
+	File::Path::make_path( $dir );
 	Vhffs::Robots::chmod_recur( $dir , 0664 , 02775 );
 	Vhffs::Robots::chown_recur( $dir , $mercurial->get_owner_uid , $mercurial->get_owner_gid );
 	$mercurial->add_history('Ok, robots find the empty directory and will create mercurial repository');
@@ -148,8 +151,6 @@
 
 sub delete_repo
 {
-	use File::Path;
-	use File::Basename;
 	my $mercurial = shift;
 	return -1 unless defined $mercurial;
 
@@ -157,6 +158,7 @@
 	my $dir = $mercurial->get_dir;
 	Vhffs::Robots::archive_targz( $mercurial, $dir );
 
+	# TODO:check remove_tree
 	File::Path::remove_tree($dir) if(-d $dir);
 	my $groupdir = File::Basename::dirname($dir);
 	rmdir($groupdir);

Modified: trunk/vhffs-api/src/Vhffs/Robots/Repository.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Robots/Repository.pm	2012-02-19 23:55:03 UTC (rev 2034)
+++ trunk/vhffs-api/src/Vhffs/Robots/Repository.pm	2012-02-20 21:24:44 UTC (rev 2035)
@@ -71,8 +71,7 @@
 
 		Vhffs::Robots::archive_targz( $repo, $repo->get_dir );
 
-		my $errors=[];
-		File::Path::remove_tree( $repo->get_dir, { error => \$errors });
+		File::Path::remove_tree( $repo->get_dir, { error => \my $errors });
 		if(@$errors) {
 			Vhffs::Robots::vhffs_log( sprintf( 'Something went wrong during %s download repository deletion: %s', $repo->get_name, join(', ', @$errors) ) );
 		}
@@ -99,8 +98,8 @@
 	my $repodir = $repo->get_dir;
 	return -1 if( $repodir =~ /\./ );
 
-	Vhffs::Functions::create_dir( $repodir ) if( ! -d $repodir );
-	return -2 if( ! -d $repodir );
+	File::Path::make_path( $repodir, { error => \my $errors });
+	return -2 if @$errors;
 
 	chown( $repo->get_owner_uid , $repo->get_owner_gid , $repodir );
 	chmod( 02775 , $repodir );

Modified: trunk/vhffs-api/src/Vhffs/Robots/Svn.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Robots/Svn.pm	2012-02-19 23:55:03 UTC (rev 2034)
+++ trunk/vhffs-api/src/Vhffs/Robots/Svn.pm	2012-02-20 21:24:44 UTC (rev 2035)
@@ -33,6 +33,8 @@
 
 use strict;
 use utf8;
+use File::Path;
+use File::Basename;
 
 use Vhffs::Services::Svn;
 use Vhffs::Constants;
@@ -129,7 +131,8 @@
 		return -1;
 	}
 
-	Vhffs::Functions::create_dir( $dir );
+	# TODO: check make_path
+	File::Path::make_path( $dir );
 	Vhffs::Robots::chmod_recur( $dir , 0664 , 02775 );
 	Vhffs::Robots::chown_recur( $dir , $svn->get_owner_uid , $svn->get_owner_gid );
 	$svn->add_history('Ok, robots find the empty directory and will create svn repository');
@@ -173,14 +176,13 @@
 
 sub delete_repo
 {
-	use File::Path;
-	use File::Basename;
 	my $svn = shift;
 	return -1 unless defined $svn;
 
 	my $dir = $svn->get_dir;
 	Vhffs::Robots::archive_targz( $svn, $dir );
 
+	# TODO: check remove_tree
 	File::Path::remove_tree($dir);
 	my $group_dir = File::Basename::dirname($dir);
 	rmdir $group_dir;

Modified: trunk/vhffs-api/src/Vhffs/Robots/User.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Robots/User.pm	2012-02-19 23:55:03 UTC (rev 2034)
+++ trunk/vhffs-api/src/Vhffs/Robots/User.pm	2012-02-20 21:24:44 UTC (rev 2035)
@@ -73,8 +73,7 @@
 		{
 			Vhffs::Robots::archive_targz( $user, $homedir );
 
-			my $errors=[];
-			File::Path::remove_tree( $homedir, { error => \$errors });
+			File::Path::remove_tree( $homedir, { error => \my $errors });
 			# Home directories are hashed on two levels, so we've potentially two empty directories to delete
 			$homedir = File::Basename::dirname($homedir);
 			rmdir $homedir;
@@ -100,7 +99,8 @@
 
 	my $homedir = $user->get_home;
 
-	unless( Vhffs::Functions::create_dir( $homedir ) )  {
+	File::Path::make_path( $homedir, { error => \my $errors } );
+	unless( @$errors ) {
 		chown $user->get_uid , $user->get_gid , $homedir;
 		chmod 0700, $homedir;
 

Modified: trunk/vhffs-api/src/Vhffs/Robots/Web.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Robots/Web.pm	2012-02-19 23:55:03 UTC (rev 2034)
+++ trunk/vhffs-api/src/Vhffs/Robots/Web.pm	2012-02-20 21:24:44 UTC (rev 2035)
@@ -55,20 +55,16 @@
 		$web->add_history( "Ok, the robot take the creation of this object. Web directory will be created");
 		my $webdir = $web->get_dir;
 
-		Vhffs::Functions::create_dir( $webdir );
+		my @dirs = ( $webdir.'/htdocs', $webdir.'/php-include', $webdir.'/tmp' );
 
-		Vhffs::Functions::create_dir( $webdir . "/htdocs");
-		chown( $web->get_owner_uid , $web->get_owner_gid , $webdir . "/htdocs" );
-		chmod( 02775 , $webdir . "/htdocs" );
+		File::Path::make_path( @dirs, { error => \my $errors });
+		return undef if @$errors;
 
-		Vhffs::Functions::create_dir( $webdir . "/php-include");
-		chown( $web->get_owner_uid , $web->get_owner_gid , $webdir . "/php-include" );
-		chmod( 02775 , $webdir . "/php-include" );
+		foreach( @dirs ) {
+			chown( $web->get_owner_uid, $web->get_owner_gid, $_ );
+			chmod( 02775, $_ );
+		}
 
-		Vhffs::Functions::create_dir( $webdir . "/tmp");
-		chown( $web->get_owner_uid , $web->get_owner_gid , $webdir . "/tmp" );
-		chmod( 02775 , $webdir . "/tmp" );
-
 		my $group = Vhffs::Group::get_by_gid( $main , $web->get_owner_gid );
 		if(Vhffs::Robots::link_to_group( $group, $web->get_servername.'-web', $webdir ) < 0) {
 			$web->add_history( "Can't link the webdirectory to the specified group");
@@ -101,6 +97,7 @@
 
 		Vhffs::Robots::archive_targz( $web, $webdir );
 
+		# TODO: check remove_tree
 		File::Path::remove_tree( $webdir );
 		my $parent = File::Basename::dirname($webdir);
 		rmdir $parent;

Modified: trunk/vhffs-listengine/src/listengine.pl
===================================================================
--- trunk/vhffs-listengine/src/listengine.pl	2012-02-19 23:55:03 UTC (rev 2034)
+++ trunk/vhffs-listengine/src/listengine.pl	2012-02-20 21:24:44 UTC (rev 2035)
@@ -37,6 +37,7 @@
 use POSIX qw(locale_h);
 use locale;
 use Locale::gettext;
+use File::Path;
 use Mail::Internet;
 use DateTime;
 use DateTime::Format::Mail;
@@ -119,7 +120,7 @@
 	if( defined $SENDMAIL_PATH )  {
 
 		my $dir = $DIRECTORY.'/errors/';
-		Vhffs::Functions::create_dir( $dir ) unless -d $dir;
+		File::Path::make_path( $dir, { error => \my $errors }) unless -d $dir;
 		my $errorf = '/dev/null';
 		$errorf = $dir.time().'_'.$$ if -d $dir;
 
@@ -180,7 +181,7 @@
     return unless( defined $message_id  &&  $message_id ne '' );
 
     my $directory = $DIRECTORY.'/archives/'.$list->get_domain.'/'.$list->get_localpart.'/'.$year.'/'.$month.'/'.$day;
-    Vhffs::Functions::create_dir( $directory ) if( ! -d $directory );
+	File::Path::make_path( $directory, { error => \my $errors }) unless -d $directory;
 
     my $file = $directory.'/'.$message_id;
     open( FILE , '>'.$file);
@@ -203,8 +204,8 @@
     my $directory = get_moderation_dir( $list );
     my $subject = $mail->get('Subject');
 
-    Vhffs::Functions::create_dir( $directory ) if( ! -d $directory );
-    
+	File::Path::make_path( $directory, { error => \my $errors }) unless -d $directory;
+
     my $filehash = Digest::MD5::md5_hex( $message_id );
     my $file = $directory.'/'.$filehash;
         

Modified: trunk/vhffs-robots/src/mail_createboxes.pl
===================================================================
--- trunk/vhffs-robots/src/mail_createboxes.pl	2012-02-19 23:55:03 UTC (rev 2034)
+++ trunk/vhffs-robots/src/mail_createboxes.pl	2012-02-20 21:24:44 UTC (rev 2035)
@@ -33,6 +33,7 @@
 
 use strict;
 use utf8;
+use File::Path;
 
 use lib '%VHFFS_LIB_DIR%';
 use Vhffs::Services::Mail;
@@ -54,15 +55,14 @@
 	if( defined $mail )  {
 
 		my $dir = $mail->get_box_dir( $b->{local_part} );
-		Vhffs::Functions::create_dir( $dir );
-		if( -d $dir )  {
-			Vhffs::Functions::create_dir( $dir.'/Maildir' );
-			Vhffs::Functions::create_dir( $dir.'/Maildir/cur' );
-			Vhffs::Functions::create_dir( $dir.'/Maildir/new' );
-			Vhffs::Functions::create_dir( $dir.'/Maildir/tmp' );
-			Vhffs::Robots::chmod_recur( $dir , 0600 , 0700 );
-			Vhffs::Robots::chown_recur( $dir , $mailconf->{'boxes_uid'} , $mailconf->{'boxes_gid'} );
+		my $prevumask = umask 0077;
+		File::Path::make_path( $dir.'/Maildir/cur', $dir.'/Maildir/new', $dir.'/Maildir/tmp',
+			{ owner => $mailconf->{'boxes_uid'}, group => $mailconf->{'boxes_gid'}, mode => 0700, error => \my $errors });
+		umask $prevumask;
+		# make_path owner and group directives do not seem to work if owner and group and numeric
+		Vhffs::Robots::chown_recur( $dir, $mailconf->{'boxes_uid'}, $mailconf->{'boxes_gid'} );
 
+		unless( @$errors ) {
 			$mail->set_box_status( $b->{local_part} , Vhffs::Constants::ACTIVATED );
 		} else  {
 			$mail->set_box_status( $b->{local_part} , Vhffs::Constants::CREATING_ERROR );

Modified: trunk/vhffs-robots/src/mail_delete.pl
===================================================================
--- trunk/vhffs-robots/src/mail_delete.pl	2012-02-19 23:55:03 UTC (rev 2034)
+++ trunk/vhffs-robots/src/mail_delete.pl	2012-02-20 21:24:44 UTC (rev 2035)
@@ -77,8 +77,7 @@
 
 	if( defined($dir) && -d $dir && -r _ && -w _ && -x _ )  {
 		my $dir = $mail->get_dir;
-		my $errors=[];
-		File::Path::remove_tree( $mail->get_dir, { error => \$errors });
+		File::Path::remove_tree( $mail->get_dir, { error => \my $errors });
 		# Mail domain directories are hashed on two levels, so we've potentially two empty directories to delete
 		$dir = File::Basename::dirname($dir);
 		rmdir $dir;

Modified: trunk/vhffs-robots/src/mail_deleteboxes.pl
===================================================================
--- trunk/vhffs-robots/src/mail_deleteboxes.pl	2012-02-19 23:55:03 UTC (rev 2034)
+++ trunk/vhffs-robots/src/mail_deleteboxes.pl	2012-02-20 21:24:44 UTC (rev 2035)
@@ -58,6 +58,7 @@
 	Vhffs::Robots::archive_targz( $mail, $dir, [ $b->{local_part} ] ); 
 
 	if( -d $dir ) {
+		# TODO: check remove_tree
 		File::Path::remove_tree($dir);
 		# Remove the letter/ directory if empty
 		rmdir File::Basename::dirname($dir);

Modified: trunk/vhffs-robots/src/repository_stats.pl
===================================================================
--- trunk/vhffs-robots/src/repository_stats.pl	2012-02-19 23:55:03 UTC (rev 2034)
+++ trunk/vhffs-robots/src/repository_stats.pl	2012-02-20 21:24:44 UTC (rev 2035)
@@ -38,6 +38,8 @@
 
 use strict;
 use utf8;
+use File::Path;
+
 use lib '%VHFFS_LIB_DIR%';
 use Vhffs::Main;
 use Vhffs::Functions;
@@ -190,7 +192,8 @@
 			# the repository changed
 			if ( $prev ne $area )  {
 				my $dir = $log_parsed_root."/".$area."/logs";
-				Vhffs::Functions::create_dir($dir) if ( ! -d $dir );
+				# TODO: check make_path
+				File::Path::make_path( $dir ) unless -d $dir;
 
 				my $lff = $dir."/access.log";
 				close(FILEOUT);
@@ -219,7 +222,8 @@
 	my $conffile = $datadir."/awstats.".$reponame.".conf";
 
 	next if ( ! -f $logpath );
-	Vhffs::Functions::create_dir($datadir) if ( ! -d $datadir );
+	# TODO: check make_path
+	File::Path::make_path( $datadir ) unless -d $datadir;
 
 	# Create the config file
 	open( AWFILEIN , "< ".$awstats_sample );

Modified: trunk/vhffs-robots/src/web_stats.pl
===================================================================
--- trunk/vhffs-robots/src/web_stats.pl	2012-02-19 23:55:03 UTC (rev 2034)
+++ trunk/vhffs-robots/src/web_stats.pl	2012-02-20 21:24:44 UTC (rev 2035)
@@ -38,6 +38,7 @@
 
 use strict;
 use utf8;
+use File::Path;
 
 use lib '%VHFFS_LIB_DIR%';
 use Vhffs::Main;
@@ -169,7 +170,8 @@
 			if ( $prev ne $svname )  {
 				my $dir = $log_parsed_root.'/'.$web->get_hash.'/logs';
 				unless( -d $dir )  {
-					Vhffs::Functions::create_dir($dir);
+					# TODO: check make_path
+					File::Path::make_path( $dir );
 					chown( $web->get_owner_uid, $web->get_owner_gid, $dir );
 					chmod( 0770 , $dir );
 				}
@@ -205,7 +207,8 @@
 
 	next if ( ! -f $logpath );
 	unless( -d $datadir )  {
-		Vhffs::Functions::create_dir($datadir);
+		# TODO: check make_path
+		File::Path::make_path( $datadir );
 		chown( $web->get_owner_uid, $web->get_owner_gid, $datadir );  
 		chmod( 0775 , $datadir );
 	}


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