line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::FTPTurboSync::FileLeaf; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
425
|
use Net::FTPTurboSync::FileObject; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
28
|
|
4
|
1
|
|
|
1
|
|
6
|
use base qw(Net::FTPTurboSync::FileObject); |
|
1
|
|
|
|
|
12
|
|
|
1
|
|
|
|
|
344
|
|
5
|
|
|
|
|
|
|
sub new { |
6
|
0
|
|
|
0
|
0
|
|
my ($class, $path, $perms, $moddate, $size) = @_; |
7
|
0
|
|
|
|
|
|
my $self = $class->SUPER::new( $path, $perms ); |
8
|
0
|
|
|
|
|
|
$self->setModDate ( $moddate ); |
9
|
0
|
|
|
|
|
|
$self->setSize ( $size ); |
10
|
0
|
|
|
|
|
|
return $self; |
11
|
|
|
|
|
|
|
} |
12
|
|
|
|
|
|
|
# return date of last modification in the epoch format ( integer ) |
13
|
|
|
|
|
|
|
sub getModDate { |
14
|
0
|
|
|
0
|
0
|
|
my ( $self ) = @_; |
15
|
0
|
|
|
|
|
|
return $self->{_moddate}; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
sub setModDate { |
18
|
0
|
|
|
0
|
0
|
|
my ( $self, $newmoddate ) = @_; |
19
|
0
|
|
|
|
|
|
return $self->{_moddate} = $newmoddate ; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
# return size of the file |
22
|
|
|
|
|
|
|
sub getSize { |
23
|
0
|
|
|
0
|
0
|
|
my ( $self ) = @_; |
24
|
0
|
|
|
|
|
|
return $self->{_size}; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
sub setSize { |
27
|
0
|
|
|
0
|
0
|
|
my ( $self, $newsize ) = @_; |
28
|
0
|
|
|
|
|
|
return $self->{_size} = $newsize ; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
# return true if objects are coincidence |
31
|
|
|
|
|
|
|
sub equal { |
32
|
|
|
|
|
|
|
# one of these is remote |
33
|
0
|
|
|
0
|
0
|
|
my ( $remotef, $localf ) = Net::FTPTurboSync::FileObject->sortByLocation( @_ ); |
34
|
0
|
|
0
|
|
|
|
return !( $remotef->isNew() or |
35
|
|
|
|
|
|
|
$remotef->getModDate() < $localf->getModDate() or |
36
|
|
|
|
|
|
|
$remotef->getSize() != $localf->getSize() or |
37
|
|
|
|
|
|
|
$remotef->getPerms() != $localf->getPerms() |
38
|
|
|
|
|
|
|
); |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |