Added event migration (to deep storage) function.

git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@2586 e3e1d417-86f3-4887-817a-d78f3d33393f
pull/27/merge
stan 2008-07-21 15:56:59 +00:00
parent 6880f9e2bb
commit 14a05cac4a
2 changed files with 611 additions and 509 deletions

View File

@ -45,6 +45,7 @@ our %EXPORT_TAGS = (
executeShellCommand
getEventPath
deleteEventFiles
makePath
) ]
);
push( @{$EXPORT_TAGS{all}}, @{$EXPORT_TAGS{$_}} ) foreach keys %EXPORT_TAGS;
@ -149,6 +150,32 @@ sub deleteEventFiles( $;$ )
}
}
sub makePath( $$ )
{
my $root = shift;
my $path = shift;
Debug( "Creating path '$path'\n" );
my @parts = split( '/', $path );
my $subpath = $root;
foreach my $dir ( @parts )
{
$subpath .= '/'.$dir;
if ( !-d $subpath )
{
if ( -e $subpath )
{
die( "Can't create '$subpath', already exists as non directory" );
}
else
{
Debug( "Creating '$subpath'\n" );
mkdir( $subpath ) or die( "Can't mkdir '$subpath': $!" );
}
}
}
}
1;
__END__
# Below is stub documentation for your module. You'd better edit it!

File diff suppressed because it is too large Load Diff