From 034a87b93fddb9f7973f9e8124a76e0d600445ee Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Fri, 24 Apr 2009 09:37:08 +0000 Subject: [PATCH] create var/estraier if it doesn't exist git-svn-id: svn+ssh://mjesec/home/dpavlin/svn/webpac2/trunk@1148 07558da8-63fa-0310-ba24-9fe276d99e06 --- lib/WebPAC/Output/Estraier.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/WebPAC/Output/Estraier.pm b/lib/WebPAC/Output/Estraier.pm index fa95063..fbf0900 100644 --- a/lib/WebPAC/Output/Estraier.pm +++ b/lib/WebPAC/Output/Estraier.pm @@ -11,6 +11,7 @@ use Data::Dump qw/dump/; use LWP; use URI::Escape; use List::Util qw/first/; +use File::Path qw/mkpath/; use YAML; =head1 NAME @@ -294,7 +295,11 @@ sub finish { my $self = shift; my $log = $self->_get_logger(); - my $path = 'var/estraier/' . $self->{database} . '.yaml'; + my $path = 'var/estraier'; + + mkpath $path unless -e $path; + + $path .= '/' . $self->{database} . '.yaml'; YAML::DumpFile( $path, $self->{stats} ); $log->info("created $path ", -s $path, " bytes"); $log->debug( dump( $self->{stats} ) ); -- 2.20.1