summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfukachan <fukachan>2002-09-15 00:11:42 +0000
committerfukachan <fukachan>2002-09-15 00:11:42 +0000
commit4523d35e5d720a61260acd3520d912e2a2e41e24 (patch)
tree4562d419ee8bda9dc2de45f97e53c763d91a20b7
parentba2b04ae60a0e3e231202f932a3c4a1ddaab10b4 (diff)
downloadfml8-4523d35e5d720a61260acd3520d912e2a2e41e24.tar.gz
fml8-4523d35e5d720a61260acd3520d912e2a2e41e24.tar.bz2
fml8-4523d35e5d720a61260acd3520d912e2a2e41e24.zip
switched to use of $curproc->mkdir() if could
-rw-r--r--fml/lib/FML/Article.pm11
-rw-r--r--fml/lib/FML/Command/Admin/check.pm4
-rw-r--r--fml/lib/FML/Command/Admin/newml.pm28
-rw-r--r--fml/lib/FML/Command/HTMLify.pm5
-rw-r--r--fml/lib/FML/Process/Distribute.pm11
-rw-r--r--fml/lib/FML/Process/Kernel.pm10
-rw-r--r--fml/lib/FML/Process/Scheduler.pm7
-rw-r--r--fml/lib/FML/Process/Spool.pm6
8 files changed, 27 insertions, 55 deletions
diff --git a/fml/lib/FML/Article.pm b/fml/lib/FML/Article.pm
index 6108eedf..5875b80e 100644
--- a/fml/lib/FML/Article.pm
+++ b/fml/lib/FML/Article.pm
@@ -4,7 +4,7 @@
# All rights reserved. This program is free software; you can
# redistribute it and/or modify it under the same terms as Perl itself.
#
-# $FML: Article.pm,v 1.44 2002/09/06 04:13:11 fukachan Exp $
+# $FML: Article.pm,v 1.45 2002/09/11 23:18:01 fukachan Exp $
#
package FML::Article;
@@ -176,11 +176,7 @@ sub spool_in
if ( $config->yes( 'use_spool' ) ) {
unless (-d $spool_dir) {
- eval q{
- use File::Path;
- mkpath( $spool_dir, 0, 0700 );
- };
- LogError($@) if $@;
+ $curproc->mkdir($spool_dir, "mode=private");
}
# translate the article path e.g. spool/1900, spool/2/1900
@@ -268,8 +264,7 @@ sub _filepath
my $dir = $spool->dirpath($args);
unless (-d $dir) {
- eval q{ use File::Utils qw(mkdirhier);};
- mkdirhier($dir, 0700);
+ $curproc->mkdir($dir, "mode=private");
}
return ($file, $dir);
diff --git a/fml/lib/FML/Command/Admin/check.pm b/fml/lib/FML/Command/Admin/check.pm
index 19337c37..1396c55b 100644
--- a/fml/lib/FML/Command/Admin/check.pm
+++ b/fml/lib/FML/Command/Admin/check.pm
@@ -4,7 +4,7 @@
# All rights reserved. This program is free software; you can
# redistribute it and/or modify it under the same terms as Perl itself.
#
-# $FML: check.pm,v 1.1 2002/04/30 16:17:14 fukachan Exp $
+# $FML: check.pm,v 1.2 2002/06/01 05:02:32 fukachan Exp $
#
package FML::Command::Admin::check;
@@ -88,7 +88,7 @@ sub check_spool_dir
}
else {
print "fail. not exist\n";
- -d $spool_dir || midir($spool_dir, 0700);
+ -d $spool_dir || $curproc->($spool_dir, "mode=private");
print " created $spool_dir\n";
}
diff --git a/fml/lib/FML/Command/Admin/newml.pm b/fml/lib/FML/Command/Admin/newml.pm
index 42f743c2..1b4e99d3 100644
--- a/fml/lib/FML/Command/Admin/newml.pm
+++ b/fml/lib/FML/Command/Admin/newml.pm
@@ -4,7 +4,7 @@
# All rights reserved. This program is free software; you can
# redistribute it and/or modify it under the same terms as Perl itself.
#
-# $FML: newml.pm,v 1.49 2002/08/28 15:07:07 fukachan Exp $
+# $FML: newml.pm,v 1.50 2002/09/11 23:18:08 fukachan Exp $
#
package FML::Command::Admin::newml;
@@ -140,20 +140,16 @@ sub _init_ml_home_dir
my $config = $curproc->{ 'config' };
my $ml_home_dir = $config->{ ml_home_dir };
- eval q{
- use File::Utils qw(mkdirhier);
- unless (-d $ml_home_dir) {
- mkdirhier( $ml_home_dir, $config->{ default_dir_mode } || 0755 );
- }
- };
- croak($@) if $@;
+ unless (-d $ml_home_dir) {
+ $curproc->mkdir($ml_home_dir, "mode=public");
+ }
# $ml_home_dir/etc/mail
my $dirlist = $config->get_as_array_ref('newml_command_init_dirs');
for my $_dir (@$dirlist) {
unless (-d $_dir) {
print STDERR "creating $_dir\n";
- mkdirhier( $_dir, $config->{ default_dir_mode } || 0755 );
+ $curproc->mkdir( $_dir, "mode=public");
}
}
}
@@ -285,12 +281,9 @@ sub _setup_mail_archive_dir
my $config = $curproc->{ config };
my $dir = $config->{ html_archive_dir };
- eval q{ use File::Utils qw(mkdirhier);};
- croak($@) if $@;
-
unless (-d $dir) {
print STDERR "creating $dir\n";
- mkdirhier( $dir, $config->{ default_dir_mode } || 0755 );
+ $curproc->mkdir($dir, "mode=public");
}
}
@@ -312,9 +305,6 @@ sub _setup_cgi_interface
#
# 1. create directory path if needed
#
- eval q{ use File::Utils qw(mkdirhier);};
- croak($@) if $@;
-
my (%is_dir_exists) = ();
my $cgi_base_dir = $config->{ cgi_base_dir };
my $admin_cgi_dir = $config->{ admin_cgi_base_dir };
@@ -323,7 +313,7 @@ sub _setup_cgi_interface
unless (-d $dir) {
print STDERR "creating $dir\n";
$is_dir_exists{ $dir } = 0;
- mkdirhier( $dir, $config->{ default_dir_mode } || 0755 );
+ $curproc->mkdir($dir, "mode=public");
}
else {
$is_dir_exists{ $dir } = 1;
@@ -411,10 +401,8 @@ sub _setup_listinfo
my $template_dir = $config->{ listinfo_template_dir };
my $listinfo_dir = $config->{ listinfo_dir };
- eval q{ use File::Utils qw(mkdirhier);};
- croak($@) if $@;
unless (-d $listinfo_dir) {
- mkdirhier($listinfo_dir, $config->{ default_dir_mode } || 0755 );
+ $curproc->mkdir($listinfo_dir, "mode=public");
}
use DirHandle;
diff --git a/fml/lib/FML/Command/HTMLify.pm b/fml/lib/FML/Command/HTMLify.pm
index adf8909a..684456a2 100644
--- a/fml/lib/FML/Command/HTMLify.pm
+++ b/fml/lib/FML/Command/HTMLify.pm
@@ -4,7 +4,7 @@
# All rights reserved. This program is free software; you can
# redistribute it and/or modify it under the same terms as Perl itself.
#
-# $FML: HTMLify.pm,v 1.7 2002/06/30 01:22:26 fukachan Exp $
+# $FML: HTMLify.pm,v 1.8 2002/09/11 23:18:05 fukachan Exp $
#
package FML::Command::HTMLify;
@@ -55,8 +55,7 @@ sub convert
if (defined $dst_dir) {
unless (-d $dst_dir) {
- use File::Utils qw(mkdirhier);
- mkdirhier($dst_dir, 0755);
+ $curproc->mkdir($dst_dir, "mode=public");
}
if ($is_subdir_exists) {
diff --git a/fml/lib/FML/Process/Distribute.pm b/fml/lib/FML/Process/Distribute.pm
index 83f38e0f..a4cb77b5 100644
--- a/fml/lib/FML/Process/Distribute.pm
+++ b/fml/lib/FML/Process/Distribute.pm
@@ -3,7 +3,7 @@
# Copyright (C) 2000,2001,2002 Ken'ichi Fukamachi
# All rights reserved.
#
-# $FML: Distribute.pm,v 1.94 2002/09/02 03:31:43 fukachan Exp $
+# $FML: Distribute.pm,v 1.95 2002/09/11 23:18:14 fukachan Exp $
#
package FML::Process::Distribute;
@@ -514,13 +514,8 @@ sub htmlify
};
unless ($@) {
unless (-d $html_dir) {
- eval q{
- use File::Path;
- mkpath($html_dir, 0, 0755);
- Log("mkdir $html_dir") if -d $html_dir;
- LogError("fail to mkdir $html_dir") unless -d $html_dir;
- };
- if ($@) { LogError($@);}
+ $curproc->mkdir($html_dir, "mode=public");
+ LogError("fail to mkdir $html_dir") unless -d $html_dir;
}
eval q{
diff --git a/fml/lib/FML/Process/Kernel.pm b/fml/lib/FML/Process/Kernel.pm
index e7a4eac1..4c283a10 100644
--- a/fml/lib/FML/Process/Kernel.pm
+++ b/fml/lib/FML/Process/Kernel.pm
@@ -4,7 +4,7 @@
# All rights reserved. This program is free software; you can
# redistribute it and/or modify it under the same terms as Perl itself.
#
-# $FML: Kernel.pm,v 1.134 2002/08/28 05:52:35 fukachan Exp $
+# $FML: Kernel.pm,v 1.135 2002/09/11 23:18:15 fukachan Exp $
#
package FML::Process::Kernel;
@@ -335,8 +335,7 @@ sub _lock_init
# only user "fml" should read lock files.
unless (-d $lock_dir) {
- use File::Path;
- mkpath($lock_dir, 0, 0700);
+ $curproc->mkdir($lock_dir, "mode=private");
}
use File::Spec;
@@ -435,8 +434,7 @@ sub _init_event_timeout
my $dir = $config->{ event_queue_dir };
unless (-d $dir) {
- use File::Path;
- mkpath($dir, 0, 0700);
+ $curproc->mkdir($dir, "mode=private");
}
use File::Spec;
@@ -1765,7 +1763,7 @@ sub prepare_file_to_return
my $src_file = $args->{ src };
my $charset_out = $args->{ charset };
- -d $tmp_dir || mkdir $tmp_dir, 0755;
+ -d $tmp_dir || $curproc->mkdir($tmp_dir, "mode=private");
use FileHandle;
my $rh = new FileHandle $src_file;
diff --git a/fml/lib/FML/Process/Scheduler.pm b/fml/lib/FML/Process/Scheduler.pm
index 333e16b3..763582e9 100644
--- a/fml/lib/FML/Process/Scheduler.pm
+++ b/fml/lib/FML/Process/Scheduler.pm
@@ -3,7 +3,7 @@
# Copyright (C) 2002 Ken'ichi Fukamachi
# All rights reserved.
#
-# $FML: Scheduler.pm,v 1.16 2002/08/07 14:32:45 fukachan Exp $
+# $FML: Scheduler.pm,v 1.17 2002/09/11 23:18:16 fukachan Exp $
#
package FML::Process::Scheduler;
@@ -41,10 +41,7 @@ sub new
my $qdir = $config->{ event_queue_dir };
unless (-d $qdir) {
- eval q{
- use File::Utils qw(mkdirhier);
- mkdirhier($qdir, $config->{ default_dir_mode } || 0755 );
- };
+ $curproc->mkdir($qdir, "mode=public");
}
return bless $me, $type;
diff --git a/fml/lib/FML/Process/Spool.pm b/fml/lib/FML/Process/Spool.pm
index 01ef2dea..eb951b49 100644
--- a/fml/lib/FML/Process/Spool.pm
+++ b/fml/lib/FML/Process/Spool.pm
@@ -3,7 +3,7 @@
# Copyright (C) 2002 Ken'ichi Fukamachi
# All rights reserved.
#
-# $FML: Spool.pm,v 1.8 2002/08/14 03:31:57 fukachan Exp $
+# $FML: Spool.pm,v 1.9 2002/09/11 23:18:16 fukachan Exp $
#
package FML::Process::Spool;
@@ -165,7 +165,7 @@ sub _convert
if ($src_dir eq $dst_dir) {
$src_dir .= ".old";
rename($dst_dir, $src_dir);
- mkdir($dst_dir, 0700);
+ $curproc->mkdir($dst_dir, "mode=private");
$use_link = 1;
}
@@ -198,7 +198,7 @@ sub _convert
}
else {
unless (-d $subdirpath) {
- mkdir($subdirpath, 0700);
+ $curproc->mkdir($subdirpath, "mode=private");
}
if (-d $subdirpath) {