/[pxelator]/lib/PXElator/file.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /lib/PXElator/file.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 290 by dpavlin, Wed Aug 26 08:43:40 2009 UTC revision 291 by dpavlin, Wed Aug 26 08:59:50 2009 UTC
# Line 10  my $debug = 1; Line 10  my $debug = 1;
10    
11  sub mkpath {  sub mkpath {
12          my $file = shift;          my $file = shift;
13          my $dir = $1 if $file =~ s{^.+/[^/]+}{};          my $dir = $1 if $file =~ s{(^.+)/[^/]+}{$1};
14          File::Path::mkpath $dir unless -e $dir;          if ( $dir && ! -d $dir ) {
15                    carp "# mkdir $dir";
16                    File::Path::mkpath $dir;
17            }
18  }  }
19    
20  sub append {  sub append {
# Line 71  sub replace { Line 74  sub replace {
74    
75  sub copy_once {  sub copy_once {
76          my ( $from, $to ) = @_;          my ( $from, $to ) = @_;
77          $to ||= $from;          die "no destination" unless $to;
78          return if -e $to;          return if -e $to;
79          mkpath $to;          mkpath $to;
80          write_file $to, read_file $from;          carp "# copy_once $from => $to";
81  #       warn "# copy_once $to ", -s $to, " bytes";          write_file $to, read_file($from);
82  }  }
83    
84  1;  1;

Legend:
Removed from v.290  
changed lines
  Added in v.291

  ViewVC Help
Powered by ViewVC 1.1.26