line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::FTPTurboSync::RemoteDir; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
7
|
use Net::FTPTurboSync::FileNode; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
21
|
|
4
|
1
|
|
|
1
|
|
555
|
use Net::FTPTurboSync::MixRemote; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
30
|
|
5
|
1
|
|
|
1
|
|
6
|
use base qw(Net::FTPTurboSync::FileNode Net::FTPTurboSync::MixRemote); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
337
|
|
6
|
|
|
|
|
|
|
# return true if object doesn't already exist |
7
|
|
|
|
|
|
|
sub deleteRemoteObjAndCheck { |
8
|
0
|
|
|
0
|
0
|
|
my ( $self, $path, $ftp ) = @_; |
9
|
0
|
|
|
|
|
|
my $res = $ftp->rmdir ( $path ); |
10
|
0
|
0
|
0
|
|
|
|
return defined( $res ) and ( $res eq 1 ) |
11
|
|
|
|
|
|
|
or ( ! $ftp->ls ( $path ) ); |
12
|
|
|
|
|
|
|
} |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub instantiateObject { |
15
|
0
|
|
|
0
|
0
|
|
my ( $class, $path, $info ) = @_; |
16
|
0
|
|
|
|
|
|
return $class->new ( $path, $info->{perms} ); |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
sub set { |
19
|
0
|
|
|
0
|
0
|
|
my ( $self, $locald ) = @_; |
20
|
0
|
0
|
|
|
|
|
if ( $self->isNew ){ |
21
|
0
|
|
|
|
|
|
my $x = $locald->getPath; |
22
|
0
|
|
|
|
|
|
my $res = $self->{ftp}->mkdir( $x ); |
23
|
0
|
0
|
0
|
|
|
|
if ( !defined($res) and !$self->{ftp}->ls($x) ){ |
24
|
0
|
|
|
|
|
|
NetWorkEx->throw ( "Cannot create '" . $locald->getPath() . "' directory" ); |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
} |
27
|
0
|
|
|
|
|
|
$self->{ftp}->setPerms ( $locald->getPath, $locald->getPerms ); |
28
|
0
|
0
|
|
|
|
|
if ( $self->isNew ){ |
29
|
0
|
|
|
|
|
|
$self->{dbh}->createDir ( $locald->getPath, $locald->getPerms ); |
30
|
|
|
|
|
|
|
}else { |
31
|
0
|
|
|
|
|
|
$self->{dbh}->setPerms ( $locald->getPath, $locald->getPerms ); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
1; |