File-DirSync
view release on metacpan or search on metacpan
lib/File/DirSync.pm view on Meta::CPAN
}
if (!-e $dst) {
warn "$dst: Never created?!!!\n";
push @{ $self->{_tracking}->{failed} }, $dst if $self->{_tracking};
$self->_op if $self->{_gentle_percent};
return;
}
# Force permissions to match the source
chmod( $stat_src[2] & 0777, $dst) or warn "$dst: Failed to chmod: $!\n";
# Force user and group ownership to match the source
chown( $stat_src[4], $stat_src[5], $dst) or warn "$dst: Failed to chown: $!\n";
# Force timestamp to match the source.
utime $when_src, $when_src, $dst or warn "$dst: Failed to utime: $!\n";
$self->_op(4) if $self->{_gentle_percent};
return;
}
# Missing Check
if (!-e _) {
# The source does not exist
# The destination must also not exist
lib/File/DirSync.pm view on Meta::CPAN
$0 = "$self->{proctitle} - syncing: $src => $dst" if $self->{proctitle};
# %nodes is now a union set of all nodes
# in both the source and destination.
# Recursively call myself for each node.
foreach $node (keys %nodes) {
$self->_dirsync("$src/$node", "$dst/$node");
}
# Force permissions to match the source
chmod( $stat_src[2] & 0777, $dst) or warn "$dst: Failed to chmod: $!\n";
# Force user and group ownership to match the source
chown( $stat_src[4], $stat_src[5], $dst) or warn "$dst: Failed to chown: $!\n";
# Force timestamp to match the source.
utime $when_src, $when_src, $dst or warn "$dst: Failed to utime: $!\n";
$self->_op(5) if $self->{_gentle_percent};
return;
}
print "$src: Unimplemented weird type of file! Skipping...\n" if $self->{verbose};
}
sub only {
( run in 0.870 second using v1.01-cache-2.11-cpan-71847e10f99 )