summaryrefslogtreecommitdiff
path: root/fml/lib/FML/Article.pm
diff options
context:
space:
mode:
authorfukachan <fukachan>2003-04-20 02:49:52 +0000
committerfukachan <fukachan>2003-04-20 02:49:52 +0000
commit5281ebd1e1d3afa359eb932b331901ceceb758a4 (patch)
treeeca10baf2bf83407671dcd36d3fb3d916a306b6f /fml/lib/FML/Article.pm
parentca35b400df62289c2568f89d3a75168636b003d7 (diff)
downloadfml8-5281ebd1e1d3afa359eb932b331901ceceb758a4.tar.gz
fml8-5281ebd1e1d3afa359eb932b331901ceceb758a4.tar.bz2
fml8-5281ebd1e1d3afa359eb932b331901ceceb758a4.zip
, not *path() method but spool_in() creates subdir if needed
Diffstat (limited to 'fml/lib/FML/Article.pm')
-rw-r--r--fml/lib/FML/Article.pm18
1 files changed, 10 insertions, 8 deletions
diff --git a/fml/lib/FML/Article.pm b/fml/lib/FML/Article.pm
index 4652d33a..b299d3a1 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.54 2003/03/16 08:38:58 fukachan Exp $
+# $FML: Article.pm,v 1.55 2003/03/16 10:44:40 fukachan Exp $
#
package FML::Article;
@@ -138,7 +138,7 @@ sub spool_in
my $use_subdir = $config->{ spool_type } eq 'subdir' ? 1 : 0;
my $channel = $self->get_lock_channel_name();
- if ( $config->yes( 'use_spool' ) ) {
+ if ($config->yes( 'use_spool' )) {
$curproc->lock($channel);
unless (-d $spool_dir) {
@@ -148,6 +148,14 @@ sub spool_in
# translate the article path e.g. spool/1900, spool/2/1900
my $file = $self->filepath($id);
+ # verify and create subdir if not found before spool in.
+ if ($use_subdir) {
+ my $dir = $self->subdirpath($id);
+ unless (-d $dir) {
+ $curproc->mkdir($dir, "mode=private");
+ }
+ }
+
unless (-f $file) {
use FileHandle;
my $fh = new FileHandle;
@@ -231,12 +239,6 @@ sub _filepath
my $file = $spool->filepath($args);
my $dir = $spool->dirpath($args); # spool/ or spool/$subdir/
- if ($use_subdir) {
- unless (-d $dir) {
- $curproc->mkdir($dir, "mode=private");
- }
- }
-
return ($file, $dir);
}