Changeset 448

Show
Ignore:
Timestamp:
04/01/06 04:10:39
Author:
miyagawa
Message:

path_to now creates necessary directories. Fixes #118

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/plagger/lib/Plagger/Cache.pm

    r368 r448  
    11package Plagger::Cache; 
    22use strict; 
     3use File::Path; 
    34use File::Spec; 
    45use HTTP::Cookies; 
     
    3334sub path_to { 
    3435    my($self, @path) = @_; 
     36    if (@path > 1) { 
     37        my @chunk = @path[0..$#path-1]; 
     38        mkpath(File::Spec->catfile(@chunk), 0, 0700); 
     39    } 
    3540    File::Spec->catfile($self->{base}, @path); 
    3641}