Branch Coverage

blib/lib/Net/SFTP/Foreign.pm
Criterion Covered Total %
branch 13 1352 0.9


line true false branch
19 3 0 if ($] >= 5.008) { }
57 0 3 if ($^O =~ /solaris/i)
58 0 0 unless defined $dirty_cleanup
66 0 0 if (warnings::enabled('deprecated') and warnings::enabled('Net::SFTP::Foreign'))
91 0 0 if ($debug and $debug & 1)
96 0 0 if $debug & 16
109 0 0 if $debug and $debug & 32
112 0 0 defined $status ? :
0 0 unless $sftp->{'_status'}
115 0 0 defined $err ? :
0 0 @str ? :
0 0 unless $sftp->{'_error'}
126 0 0 unless $sftp->{'_error'}
132 0 0 if $debug and $debug & 1
134 0 0 unless ($sftp->_do_io($sftp->{'_timeout'}))
143 0 0 if ($debug and $debug & 1)
146 0 0 if $code == 2
147 0 0 unless $code == 101
150 0 0 if $debug & 8
157 0 0 if (@_)
158 0 0 @_ > 1 ? :
174 0 0 if ${^TAINT}
177 0 0 if @_ & 1
191 0 0 if ($debug)
202 0 0 unless (ref $backend)
203 0 0 $windows ? :
0 0 unless defined $backend
205 0 0 unless $backend =~ /^\w+$/
208 0 0 unless eval "require $backend_class; 1"
214 0 0 if ($debug)
235 0 0 if defined $sftp->{'_timeout'} and $sftp->{'_timeout'} <= 0
238 0 0 if (defined $sftp->{'_fs_encoding'}) { }
239 0 0 if $] < 5.008
249 0 0 if %opts
251 0 0 unless $sftp->{'_error'}
258 0 0 if (not defined $ad or $ad == 2) { }
259 0 0 if $debug and $debug & 4
265 0 0 if ($ad == 0) { }
0 0 elsif ($ad == 1) { }
282 0 0 if $debug and $debug & 4
287 0 0 if (defined $pid)
288 0 0 if defined $sftp->{'ssh_out'} and not $sftp->{'_ssh_out_is_not_dupped'}
289 0 0 if defined $sftp->{'ssh_in'}
290 0 0 if ($windows) { }
291 0 0 if kill 'KILL', $pid
293 0 0 if $debug and $debug & 4
298 0 0 defined $sftp->{'_dirty_cleanup'} ? :
300 0 0 if ($dirty or not defined $dirty) { }
301 0 0 if $debug and $debug & 4
302 0 0 $dirty ? :
303 0 0 if $debug and $debug & 4
304 0 0 if $sig
311 0 0 if $debug and $debug & 4
312 0 0 if $wpr or $! == 10
320 0 0 if waitpid($pid, 0) > 0
321 0 0 if ($! != 4)
322 0 0 if $! != 10
328 0 0 if $debug and $debug & 4
331 0 0 if defined $sftp->{'_pty'}
342 0 0 if $debug and $debug & 4
347 0 0 if (not defined $dbpid or $dbpid == $$ and $dbthread == $thread_generation) { }
351 0 0 if $debug and $debug & 4
360 0 0 if (my $msg = $sftp->_get_msg) { }
0 0 elsif ($sftp->{'_status'} == 7 and $sftp->{'_password_authentication'} and $sftp->{'_password_sent'}) { }
362 0 0 if ($type == 2)
372 0 0 if ($key eq 'vendor-id') { }
0 0 elsif ($key eq 'supported2') { }
414 0 0 if defined $ext and $ext == $version
428 0 0 if $id == $eid
429 0 0 unless (exists $sftp->{'incomming'}{$id})
442 0 0 if ($msg)
448 0 0 if ($type != $etype)
449 0 0 if ($type == 101) { }
452 0 0 defined $str ? :
469 0 0 if (my $msg = $sftp->_get_msg_and_check(102, $eid, $error, $errstr))
479 0 0 unless (defined $rid)
499 0 0 unless defined $rid
501 0 0 defined $attrs ? :
517 0 0 defined $attrs ? :
523 0 0 if (defined $eid)
524 0 0 if (my $msg = $sftp->_get_msg_and_check(101, $eid, $error, $errstr))
527 0 0 if $status == 0
536 0 0 if ${^TAINT}
542 0 0 unless defined $check
544 0 0 if %opts
546 0 0 if (defined $cwd) { }
547 0 0 if ($check) { }
549 0 0 unless defined $cwd
551 0 0 unless my $a = $sftp->stat($cwd)
553 0 0 unless (_is_dir($a->perm))
566 0 0 if defined wantarray
571 0 0 unless @_ == 1
574 0 0 defined $sftp->{'cwd'} ? :
580 0 0 unless @_ >= 2 and @_ <= 4
582 0 0 if ${^TAINT}
586 0 0 unless defined $flags
587 0 0 unless defined $a
596 0 0 if ($debug and $debug & 2)
597 0 0 if (defined $rid) { }
606 0 0 unless defined $rid
609 0 0 if $flags & 4
621 0 0 unless ($fh)
622 0 0 if ($mkpath and $sftp->status == 2) { }
625 0 0 unless $sftp->mkpath($filename, $da, 1)
637 0 0 unless @_ <= 2
638 0 0 if ${^TAINT}
642 0 0 unless defined $path
648 0 0 if ($debug and $debug & 2)
653 0 0 unless defined $rid
662 0 0 unless @_ >= 3 and @_ <= 4
667 0 0 unless ($size)
668 0 0 if defined $size
673 0 0 unless defined $rfid
678 0 0 if (my $msg = $sftp->_get_msg_and_check(103, $id, 5, q[Couldn't read from remote file]))
689 0 0 unless @_ == 4
693 0 0 unless defined $rfid
694 0 0 unless utf8::downgrade($_[3], 1)
699 0 0 if ($sftp->_check_status_ok($id, 16, q[Couldn't write to remote file]))
708 0 0 unless @_ >= 3 and @_ <= 4
712 0 0 unless $sftp->flush($rfh)
714 0 0 if (not $whence) { }
0 0 elsif ($whence == 1) { }
0 0 elsif ($whence == 2) { }
721 0 0 unless my $a = $sftp->stat($rfh)
731 0 0 unless @_ == 2
738 0 0 unless @_ == 2
751 0 0 unless defined $rfid
763 0 0 if (defined $data and length $data) { }
777 0 0 unless ($sftp->_check_status_ok($eid, 16, q[Couldn't write to remote file]))
791 0 0 unless @_ == 3
794 0 0 unless $sftp->flush($rfh, 'in')
795 0 0 unless utf8::downgrade($_[2], 1)
802 0 0 if $len >= $sftp->{'_write_delay'} or $len and $sftp->{'_autoflush'}
808 0 0 unless @_ >= 2 and @_ <= 3
814 0 0 unless defined $sftp->_rfid($rfh)
816 0 0 if ($dir ne 'out')
820 0 0 if ($dir ne 'in')
823 0 0 if ($len)
826 0 0 if ($append) { }
827 0 0 unless my $attr = $sftp->stat($rfh)
842 0 0 unless $append
846 0 0 unless $written == $len
857 0 0 unless $sftp->flush($rfh, 'out')
861 0 0 unless defined $rfid
865 0 0 if (defined $len)
866 0 0 if $len < length $$bin
869 0 0 if $len - length($$bin) < $read_ahead
894 0 0 unless my $msg = $sftp->_get_msg_and_check(103, $eid, 5, q[Couldn't read from remote file])
901 0 0 if (length $data < $bsize)
902 0 0 unless (defined $len)
912 0 0 if ($ensure_eof and $sftp->_get_msg_and_check(103, $ensure_eof, 5, q[Couldn't read from remote file]))
921 0 0 if ($sftp->{'_status'} == 1)
923 0 0 if length $$bin
927 0 0 if $sftp->_ok_or_autodie
931 0 0 unless @_ == 3
934 0 0 if ($sftp->_fill_read_cache($rfh, $len))
946 0 0 if @_ < 3
955 0 0 if ($ix >= 0)
964 0 0 unless (length $$bin > $last)
966 0 0 if $sftp->{'_error'}
971 0 0 length $line ? :
977 0 0 unless @_ >= 2 and @_ <= 3
981 0 0 if @_ < 3
982 0 0 if (not defined $sep or $sep eq '')
985 0 0 if $sftp->{'_error'}
992 0 0 if (wantarray)
1003 0 0 unless @_ == 2
1009 0 0 if (length $bin)
1020 0 0 unless @_ <= 2
1021 0 0 if ${^TAINT}
1024 0 0 unless defined $path
1027 0 0 if (my $msg = $sftp->_get_msg_and_check(105, $id, 18, q[Couldn't stat remote link]))
1035 0 0 unless @_ <= 2
1036 0 0 if ${^TAINT}
1039 0 0 unless defined $pofh
1040 0 0 ref $pofh && UNIVERSAL::isa($pofh, 'Net::SFTP::Foreign::FileHandle') ? :
1043 0 0 if (my $msg = $sftp->_get_msg_and_check(105, $id, 1, q[Couldn't stat remote file]))
1062 0 0 unless @_ == 2
1063 0 0 if ${^TAINT}
1083 0 0 unless @_ >= 2 and @_ <= 3
1085 0 0 if ${^TAINT}
1088 0 0 unless defined $attrs
1104 34 0 if (defined $b)
1105 0 0 if (ref $sftp and $sftp->{'_remote_has_volumes'} and $b =~ /^([a-z]\:)(.*)/i)
1112 19 15 if (length $b and $b ne '.')
1113 2 17 if (not $b =~ m[^/] and $a ne '.') { }
1114 0 2 $a =~ m[/$] ? :
1121 0 19 unless length $a
1133 0 0 if $debug and $debug & 4096
1138 0 0 unless @_ >= 2 and @_ <= 4
1140 0 0 if ${^TAINT}
1150 0 0 if ($first) { }
1157 0 0 if $debug and $debug & 8192
1158 0 0 if ($sftp->test_d($p))
1159 0 0 if $debug and $debug & 8192
1162 0 0 unless (length $path)
1171 0 0 if $debug and $debug & 8192
1172 0 0 if ($p =~ m[^(?:.*/)?\.{1,2}$] or $p =~ m[/$]) { }
1173 0 0 if $debug and $debug & 8192
1174 0 0 unless ($sftp->test_d($p))
1175 0 0 if $debug and $debug & 8192
1177 0 0 unless $sftp->{'_error'}
1183 0 0 unless $sftp->mkdir($p, $attrs)
1196 0 0 if $debug and $debug & 32768
1198 0 0 if ($parent)
1200 0 0 unless (@parts)
1211 0 0 if (-e $target)
1212 0 0 unless (-d $target)
1224 0 0 if $debug and $debug and 32768
1225 0 0 unless (CORE::mkdir $target, $perm)
1226 0 0 unless (do { local $!; -d $target })
1233 0 0 if $debug and $debug & 32768
1238 0 0 unless @_ == 3
1239 0 0 if ${^TAINT}
1242 0 0 ref $pofh && UNIVERSAL::isa($pofh, 'Net::SFTP::Foreign::FileHandle') ? :
1266 9 0 $rid_type eq 'any' ? :
0 9 $rid_type eq 'dir' ? :
3 9 $rid_type eq 'file' ? :
1271 0 0 unless @_ == $nargs
1278 0 0 ref $pofh && UNIVERSAL::isa($pofh, 'Net::SFTP::Foreign::FileHandle') ? :
1293 0 0 unless @_ == 2
1297 0 0 unless defined $id
1303 0 0 if ($debug and $debug & 2)
1304 0 0 defined $ok ? :
1312 0 0 unless @_ == 2
1313 0 0 if ${^TAINT}
1318 0 0 unless $sftp->flush($rfh)
1321 0 0 if ($sftp->_close($rfh))
1329 0 0 unless @_ == 2
1330 0 0 if ${^TAINT}
1335 0 0 if ($sftp->_close($rdh))
1343 0 0 unless @_ == 2
1344 0 0 if ${^TAINT}
1349 0 0 unless defined $rdid
1355 0 0 if (my $msg = $sftp->_get_msg_and_check(104, $id, 29, q[Couldn't read remote directory])) { }
1358 0 0 unless my $count = $msg->get_int32
1367 0 0 if $sftp->{'_status'} == 1
1372 0 0 if (wantarray)
1382 0 0 if (wantarray) { }
1384 0 0 if (defined $line)
1396 0 0 unless @_ == 2
1397 0 0 if ${^TAINT}
1403 0 0 if (my $msg = $sftp->_get_msg_and_check(104, $id, $error, "Couldn't get $name for remote '${path}'"))
1406 0 0 if $msg->get_int32 > 0
1444 0 0 unless @_ & 1
1445 0 0 if ${^TAINT}
1451 0 0 if $overwrite and $numbered
1453 0 0 if %opts
1455 0 0 if ($overwrite)
1456 0 0 if $sftp->atomic_rename($old, $new)
1457 0 0 if $sftp->{'_status'} != 8
1464 0 0 if (not $sftp->_rename($old, $new) and $sftp->{'_status'} == 4)
1466 0 0 if ($numbered and $sftp->test_e($new)) { }
0 0 elsif ($overwrite) { }
1473 0 0 if (defined $rp_old and defined $rp_new and $rp_old eq $rp_new) { }
0 0 elsif ($sftp->remove($new)) { }
1487 0 0 unless @_ == 3
1488 0 0 if ${^TAINT}
1492 0 0 unless $sftp->_check_extension('posix-rename@openssh.com', 1, 17, 'atomic rename failed')
1512 0 0 unless @_ == 3
1513 0 0 if ${^TAINT}
1526 0 0 unless @_ == 3
1527 0 0 if ${^TAINT}
1531 0 0 unless $sftp->_check_extension('hardlink@openssh.com', 1, 51, 'hardlink failed')
1550 0 0 if $sftp->{'_error'}
1561 0 0 unless $_[0] =~ s/^(.*)\((\d+)\)((?:\.[^\.]*)?)$/"$1(" . ($2 + 1) . ")$3";/e
1563 0 0 if $debug and $debug & 128
1570 0 0 $@ ? :
1575 0 0 unless @_ >= 2
1576 0 0 if ${^TAINT}
1579 0 0 unless defined $remote
1584 0 0 unless defined $local
1590 0 0 exists $opts{'copy_perm'} ? :
1605 0 0 if defined $perm and defined $copy_perm
1607 0 0 if $numbered and $overwrite || $resume || $append
1609 0 0 if ($resume or $append)
1610 0 0 if $resume and $append
1611 0 0 if $atomic
1612 0 0 if $overwrite
1615 0 0 if ($local_is_fh)
1617 0 0 if $resume
1618 0 0 if $overwrite
1619 0 0 if $numbered
1620 0 0 if $dont_save
1621 0 0 if $atomic
1623 0 0 if %opts
1625 0 0 if ($resume and $conversion)
1630 0 0 unless defined $overwrite or $local_is_fh or $numbered or $append
1631 0 0 unless defined $perm or defined $copy_perm or $local_is_fh
1632 0 0 unless defined $copy_time or $local_is_fh
1633 0 0 unless defined $mkpath
1634 0 0 unless defined $cleanup
1640 0 0 $a ? :
1641 0 0 unless defined $size
1643 0 0 if ($copy_time and not defined $atime)
1644 0 0 if ($best_effort) { }
1648 0 0 if $sftp->_ok_or_autodie
1654 0 0 defined $perm ? :
0 0 unless defined $umask
1655 0 0 if ($copy_perm)
1656 0 0 if (defined $rperm) { }
0 0 elsif ($best_effort) { }
1663 0 0 if $sftp->_ok_or_autodie
1668 0 0 if defined $perm
1672 0 0 if ($resume and $resume eq 'auto')
1674 0 0 if (defined $mtime)
1675 0 0 if (my(@lstat) = CORE::stat $local)
1687 0 0 if ($dont_save) { }
1689 0 0 unless defined $rfh
1692 0 0 unless ($local_is_fh or $overwrite or $append or $resume or $numbered)
1693 0 0 if (-e $local)
1700 0 0 if ($atomic)
1705 0 0 if $debug and $debug & 128
1708 0 0 if ($resume)
1709 0 0 if (CORE::open $fh, '+<', $local)
1713 0 0 if ($askoff < 0) { }
1720 0 0 if ($size >= 0 and $askoff > $size)
1725 0 0 if $size == $askoff
1733 0 0 unless defined $rfh
1735 0 0 unless (defined $fh)
1736 0 0 if ($local_is_fh) { }
1740 0 0 unless $lstart and $lstart > 0
1744 0 0 if $append
1745 0 0 if $numbered or not $overwrite || $append
1746 0 0 if $overwrite
1747 0 0 defined $perm ? :
1749 0 0 if $mkpath
1751 0 0 if sysopen $fh, $local, $flags, $open_perm
1752 0 0 unless ($numbered and -e $local)
1759 0 0 if ref $numbered
1761 0 0 if $append
1765 0 0 if (defined $perm)
1769 0 0 unless (eval { do { CORE::chmod($perm, $local) > 0 } })
1770 0 0 $@ ? :
1773 0 0 if ($error and not $best_effort)
1774 0 0 unless $resume or $append
1785 0 0 unless defined $rfid
1793 0 0 $size == -1 ? :
1817 0 0 if $slow_start
1826 0 0 unless ($msg)
1827 0 0 if $sftp->{'_status'} == 1
1834 0 0 if ($roff != $loff or not $len)
1841 0 0 unless ($safe_block_size)
1842 0 0 if ($len > $sftp->{'_min_block_size'})
1844 0 0 if ($len < $block_size)
1854 0 0 if $converter
1856 0 0 if (length $data and defined $cb)
1863 0 0 if $sftp->{'_error'}
1866 0 0 if (length $data and not $dont_save)
1867 0 0 unless (print $fh $data)
1877 0 0 if $sftp->{'_error'}
1881 0 0 if ($converter)
1886 0 0 if (length $data and defined $cb)
1890 0 0 if $sftp->{'_error'}
1893 0 0 if (length $data and not $dont_save)
1894 0 0 unless (print $fh $data)
1903 0 0 if (defined $cb)
1909 0 0 if $sftp->{'_error'}
1910 0 0 if (length $data and not $dont_save)
1911 0 0 unless (print $fh $data)
1919 0 0 unless ($dont_save)
1920 0 0 unless ($local_is_fh or CORE::close $fh)
1929 0 0 if ($copy_time)
1930 0 0 unless (CORE::utime $atime, $mtime, $local or $best_effort)
1937 0 0 if ($atomic)
1938 0 0 if (not $overwrite) { }
1945 0 0 if (link $local, $atomic_local)
1950 0 0 unless (-e $atomic_local)
1951 0 0 if (sysopen my $lock, $atomic_local, 193, 384)
1958 0 0 unless (-e $atomic_local)
1964 0 0 unless ($numbered)
1974 0 0 unless (CORE::rename $local, $atomic_local)
1980 0 0 if ref $atomic_numbered
1984 0 0 if ($cleanup and $sftp->{'_error'})
1986 0 0 if $atomic_cleanup
1995 0 0 unless @_ == 2
1996 0 0 if ${^TAINT}
2002 0 0 unless my $rfh = $sftp->open($name)
2009 0 0 unless @_ >= 2
2010 0 0 if ${^TAINT}
2013 0 0 unless defined $local
2018 0 0 unless (defined $remote)
2019 0 0 if $local_is_fh
2028 0 0 unless defined $copy_perm
2044 0 0 if defined $perm and defined $umask
2046 0 0 if defined $perm and $copy_perm
2048 0 0 if $resume and $append
2050 0 0 if $resume and $overwrite
2052 0 0 if $numbered and $overwrite || $resume || $append
2054 0 0 if $atomic and $resume || $append
2057 0 0 if %opts
2059 0 0 unless defined $overwrite or $numbered
2060 0 0 unless defined $perm or defined $copy_perm or $local_is_fh
2061 0 0 unless defined $copy_time or $local_is_fh
2062 0 0 unless defined $late_set_perm
2063 0 0 unless defined $cleanup
2064 0 0 unless defined $mkpath
2067 0 0 if (defined $perm) { }
2071 0 0 unless defined $umask
2076 0 0 if ($local_is_fh) { }
2081 0 0 unless (CORE::open $fh, '<', $local)
2094 0 0 if ((undef, undef, $lmode, undef, undef, undef, undef, $lsize, $latime, $lmtime) = eval { do { no warnings; CORE::stat $fh } }) { }
0 0 elsif ($copy_perm or $copy_time) { }
0 0 elsif ($resume and $resume eq 'auto') { }
2103 0 0 defined $lsize ? :
0 0 if $debug and $debug & 16384
2107 0 0 if ($local_is_fh and defined $lsize)
2109 0 0 if $tell and $tell > 0
2118 0 0 if $debug and $debug & 16384
2123 0 0 if $copy_perm
2125 0 0 if defined $perm
2133 0 0 if ($resume or $append)
2138 0 0 if ($rattrs) { }
2139 0 0 if ($resume and $resume eq 'auto' and $rattrs->mtime <= $lmtime) { }
2140 0 0 if $debug and $debug & 16384
2146 0 0 if $debug and $debug & 16384
2150 0 0 if ($append)
2151 0 0 unless $sftp->{'_status'} == 2 or $sftp->_ok_or_autodie
2161 0 0 if ($writeoff) { }
2163 0 0 if ($resume)
2164 0 0 if $debug and $debug & 16384
2165 0 0 if ($converter) { }
0 0 elsif ($local_is_fh) { }
2174 0 0 if ($delta <= $len) { }
2175 0 0 if $debug and $debug & 16384
2181 0 0 if ($eof_t)
2187 0 0 unless (defined $read)
2192 0 0 if defined $lsize
2193 0 0 unless utf8::downgrade($converted_input, 1)
2195 0 0 unless $read
2206 0 0 $off < 16384 ? :
2207 0 0 if ($read) { }
2208 0 0 if $debug and $debug & 16384
2212 0 0 defined $read ? :
2221 0 0 if (defined $lsize and $writeoff > $lsize)
2226 0 0 unless (CORE::seek $fh, $writeoff, 0)
2232 0 0 if (defined $lsize and $writeoff == $lsize)
2233 0 0 if (defined $perm and $rattrs->perm != $perm)
2240 0 0 unless $rfh = $sftp->open($remote, 2)
2244 0 0 if ($atomic)
2247 0 0 if (not $numbered || $overwrite and $sftp->test_e($remote))
2258 0 0 if $debug and $debug & 128
2261 0 0 if ($numbered) { }
2268 0 0 if $rfh or $sftp->{'_status'} != 4 or not $sftp->test_e($remote)
2272 0 0 if $rfh and ref $numbered
2280 0 0 $overwrite ? :
2286 0 0 if $rfh or $rep or not $overwrite or $sftp->{'_status'} != 3
2288 0 0 if $debug and $debug & 2
2295 0 0 unless $sftp->_ok_or_autodie
2308 0 0 if (defined $perm and not $late_set_perm)
2309 0 0 unless $sftp->_best_effort($best_effort, 'setstat', $rfh, $attrs)
2313 0 0 unless defined $rfid
2317 0 0 if $append or not defined $lsize
2324 0 0 if (not $eof and @msgid < $queue_size)
2326 0 0 if ($converter) { }
2329 0 0 unless ($read)
2330 0 0 unless (defined $read)
2341 0 0 unless utf8::downgrade($input, 1)
2347 0 0 if $eof_t and not $len
2350 0 0 if $debug and $debug & 16384
2355 0 0 if ($len) { }
2356 0 0 if $debug and $debug & 16384
2358 0 0 unless utf8::downgrade($data, 1)
2361 0 0 if $debug and $debug & 16384 and length $data != $len
2365 0 0 unless (defined $len)
2376 0 0 if (defined $cb)
2377 0 0 if $nextoff > $lsize
2380 0 0 if $sftp->{'_error'}
2382 0 0 unless utf8::downgrade($data, 1)
2388 0 0 if ($len)
2389 0 0 if ($sparse and $data =~ /^\x{00}*$/s) { }
2391 0 0 if $debug and $debug & 16384
2394 0 0 if $debug and $debug & 16384
2405 0 0 if $eof and not @msgid
2407 0 0 unless $eof or @msgid >= $queue_size or $sftp->_do_io(0)
2412 0 0 unless ($sftp->_check_status_ok($id, 16, q[Couldn't write to remote file]))
2419 0 0 unless $local_is_fh
2424 0 0 if $last_block_was_zeros and not $sftp->{'_error'}
2428 0 0 if $sftp->{'_error'}
2432 0 0 if ($copy_time or $late_set_perm and defined $perm)
2433 0 0 unless $late_set_perm and defined $perm
2434 0 0 if $copy_time
2435 0 0 unless $sftp->_best_effort($best_effort, 'setstat', $remote, $attrs)
2438 0 0 if ($atomic)
2439 0 0 unless $sftp->rename($remote, $atomic_remote, 'overwrite', $overwrite, 'numbered', $atomic_numbered)
2445 0 0 if ($cleanup and $sftp->{'_error'})
2454 0 0 unless @_ >= 3
2455 0 0 if ${^TAINT}
2461 0 0 if %opts
2464 0 0 unless (CORE::open $fh, '<', \$_[1])
2472 0 0 unless @_ >= 1
2473 0 0 if ${^TAINT}
2476 0 0 @_ & 1 ? :
2487 0 0 if ($cheap and ref $opts{'wanted'} eq 'Regexp' and not defined $opts{'no_wanted'}) { }
2496 0 0 if defined $wanted
2499 0 0 if %opts
2502 0 0 if $follow_links or $realpath or $wanted and not $delayed_wanted
2505 0 0 $max_queue_size < 2 ? :
2507 0 0 unless defined $dir
2511 0 0 unless defined $rdh
2514 0 0 unless defined $rdid
2526 0 0 unless my $msg = $sftp->_get_msg_and_check(104, $id, 29, "Couldn't read directory '${dir}'")
2529 0 0 unless my $count = $msg->get_int32
2531 0 0 if ($cheap) { }
2534 0 0 if not defined $cheap_wanted or $fn =~ /$cheap_wanted/
2550 0 0 if ($follow_links and _is_lnk($a->perm))
2552 0 0 if ($a = $sftp->stat($sftp->join($dir, $fn))) { }
2560 0 0 if ($realpath)
2562 0 0 if (defined $rp) { }
2570 0 0 if (not $wanted or $delayed_wanted or &$wanted($sftp, $entry))
2571 0 0 $names_only && !$delayed_wanted ? :
2575 0 0 if $queue_size < $max_queue_size
2577 0 0 if $sftp->{'_status'} == 1
2579 0 0 if $rdh
2581 0 0 unless ($sftp->{'_error'})
2582 0 0 if ($delayed_wanted)
2584 0 0 if $names_only
2586 0 0 defined $_->{'realpath'} ? :
2589 0 0 if ($ordered)
2590 0 0 if ($names_only) { }
2599 0 0 if $sftp->{'_autodie'}
2604 0 0 unless @_ >= 2
2605 0 0 if ${^TAINT}
2610 0 0 if $on_error
2614 0 0 if %opts
2625 0 0 if (_is_dir($e->{'a'}->perm)) { }
2629 0 0 if (not $wanted or &$wanted($sftp, $e))
2630 0 0 if ($sftp->remove($fn)) { }
2644 0 0 if (not $wanted or &$wanted($sftp, $e))
2645 0 0 if ($sftp->rmdir($e->{'filename'})) { }
2658 0 0 unless @_ >= 3
2663 0 0 if $overwrite and $numbered
2665 0 0 if %opts
2667 0 0 unless defined $overwrite or $numbered
2669 0 0 unless my $a = $sftp->lstat($remote)
2670 0 0 unless (_is_lnk($a->perm))
2676 0 0 unless my $link = $sftp->readlink($remote)
2679 0 0 if ($numbered) { }
0 0 elsif (-e $local) { }
2683 0 0 if ($overwrite) { }
2693 0 0 unless (eval { do { CORE::symlink $link, $local } })
2698 0 0 if ref $numbered
2704 0 0 unless @_ >= 3
2709 0 0 if $overwrite and $numbered
2711 0 0 if %opts
2713 0 0 unless defined $overwrite or $numbered
2715 0 0 unless (defined $perm)
2720 0 0 unless (_is_lnk($perm))
2726 0 0 unless (defined $target)
2735 0 0 if ($sftp->{'_error'} and $sftp->{'_status'} == 4)
2737 0 0 if ($numbered and $sftp->test_e($remote)) { }
0 0 elsif ($overwrite and $sftp->_remove_save_status($remote)) { }
2748 0 0 if ref $numbered
2753 0 0 unless @_ >= 2
2754 0 0 if ${^TAINT}
2757 0 0 unless defined $remote
2758 0 0 unless defined $local
2762 0 0 exists $opts{'copy_perm'} ? :
2766 0 0 if $on_error
2779 0 0 if ($get_opts{'resume'} and $get_opts{'conversion'})
2787 0 0 if %opts
2795 0 0 unless defined $copy_perm
2796 0 0 unless defined $copy_time
2797 0 0 unless defined $mkpath
2804 0 0 if (not $wanted or &$wanted($sftp, $e))
2806 0 0 if ($fn =~ /$reremote/) { }
2808 0 0 if ${^TAINT}
2809 0 0 if (-d $lpath) { }
2816 0 0 $copy_perm ? :
2817 0 0 if (CORE::mkdir $lpath, $perm or $mkpath and $sftp->_mkpath_local($lpath, $perm))
2836 0 0 unless (_is_dir($e->{'a'}->perm))
2837 0 0 if (not $wanted or &$wanted($sftp, $e))
2839 0 0 if ($fn =~ /$reremote/) { }
2840 0 0 length $1 ? :
2842 0 0 if ${^TAINT}
2843 0 0 if (_is_lnk($e->{'a'}->perm) and not $ignore_links) { }
0 0 elsif (_is_reg($e->{'a'}->perm)) { }
2844 0 0 if ($sftp->get_symlink($fn, $lpath, %get_symlink_opts))
2852 0 0 if ($newer_only and -e $lpath and (stat _)[9] >= $e->{'a'}->mtime) { }
2858 0 0 if ($sftp->get($fn, $lpath, 'copy_perm', $copy_perm, 'copy_time', $copy_time, %get_opts))
2868 0 0 $ignore_links ? :
2888 0 0 unless @_ >= 2
2889 0 0 if ${^TAINT}
2893 0 0 unless defined $local
2894 0 0 unless defined $remote
2899 0 0 exists $opts{'copy_perm'} ? :
2904 0 0 if $on_error
2920 0 0 if defined $perm and defined $umask
2922 0 0 if defined $perm and $copy_perm
2925 0 0 if %opts
2932 0 0 if ($local =~ m[^\./?$]) { }
2940 0 0 unless defined $copy_perm
2941 0 0 unless defined $copy_time
2942 0 0 unless defined $mkpath
2945 0 0 if (defined $perm) { }
2949 0 0 unless defined $umask
2953 0 0 if ($on_error)
2967 0 0 if (not $wanted or &$wanted($lfs, $e))
2969 0 0 if $debug and $debug & 32768
2970 0 0 if ($fn =~ /$relocal/) { }
2972 0 0 if $debug and $debug & 32768
2974 0 0 if (defined $perm) { }
0 0 elsif ($copy_perm) { }
2980 0 0 if ($sftp->mkdir($rpath, $a))
2984 0 0 if ($mkpath and $sftp->status == 2)
2987 0 0 if ($sftp->mkpath($rpath, $a))
2993 0 0 if ($sftp->test_d($rpath))
3011 0 0 unless (_is_dir($e->{'a'}->perm))
3012 0 0 if (not $wanted or &$wanted($lfs, $e))
3014 0 0 if $debug and $debug & 32768
3015 0 0 if ($fn =~ /$relocal/) { }
3018 0 0 if (_is_lnk($e->{'a'}->perm) and not $ignore_links) { }
0 0 elsif (_is_reg($e->{'a'}->perm)) { }
3019 0 0 if ($sftp->put_symlink($fn, $rpath, %put_symlink_opts))
3028 0 0 if ($newer_only and $ra = $sftp->stat($rpath) and $ra->mtime >= $e->{'a'}->mtime) { }
3035 0 0 $copy_perm ? :
0 0 defined $perm ? :
0 0 if ($sftp->put($fn, $rpath, defined $perm ? ('perm', $perm) : ($copy_perm ? ('perm', $e->{'a'}->perm & $mask) : ('copy_perm', 0, 'umask', $umask)), 'copy_time', $copy_time, %put_opts))
3048 0 0 $ignore_links ? :
3068 0 0 unless @_ >= 2
3069 0 0 if ${^TAINT}
3073 0 0 unless defined $remote
3076 0 0 if $on_error
3090 0 0 if %opts
3099 0 0 if (_is_dir($perm)) { }
3107 0 0 if defined $localdir
3110 0 0 if (_is_lnk($perm)) { }
3111 0 0 if $ignore_links
3118 0 0 unless $sftp->{'_error'}
3125 0 0 unless @_ >= 2
3129 0 0 unless defined $local
3132 0 0 if $on_error
3146 0 0 if %opts
3156 0 0 if (_is_dir($perm)) { }
3163 0 0 if defined $remotedir
3166 0 0 if (_is_lnk($perm)) { }
3167 0 0 if $ignore_links
3174 0 0 unless $sftp->{'_error'}
3181 0 0 unless @_ == 2
3182 0 0 if ${^TAINT}
3187 0 0 unless $sftp->_check_extension('fsync@openssh.com', 1, 53, 'fsync failed, not implemented')
3195 0 0 if ($sftp->_check_status_ok($id, 53, q[Couldn't fsync remote file]))
3204 0 0 unless @_ == 2
3205 0 0 if ${^TAINT}
3208 0 0 ref $pofh && UNIVERSAL::isa($pofh, 'Net::SFTP::Foreign::FileHandle') ? :
3212 0 0 unless $sftp->_check_extension($extension, 2, 48, 'statvfs failed, not implemented')
3221 0 0 if (my $msg = $sftp->_get_msg_and_check(201, $id, 48, q[Couldn't stat remote file system]))
3248 0 0 if (@_) { }
3261 0 0 unless $self->_check
3265 0 0 if (wantarray) { }
3267 0 0 unless @ret
3272 0 0 unless defined $ret
3309 0 0 if defined *{shift();}{'ARRAY'}->[0]
3316 0 0 unless $self->_check
3340 0 0 unless defined $flag
3341 0 0 if (@_)
3342 0 0 if (shift()) { }
3349 0 0 $st->[3] & $flag ? :
3363 0 0 if ($autoloaded) { }
3395 0 0 unless $self->_check
3398 0 0 unless defined $offset
3399 0 0 if $offset < 0
3400 0 0 unless defined $length
3405 0 0 unless defined $ret
3411 0 0 unless $self->_check
3414 0 0 unless defined $_[1]
3416 0 0 if ($offset > length $_[1])
3420 0 0 if ($len == 0)
3429 0 0 if (length $$bin)
3435 0 0 if $sftp->{'_status'} == $sftp->SSH2_FX_EOF
3442 0 0 unless $self->_check
3445 0 0 unless defined $ret
3466 0 0 if $Net::SFTP::Foreign::debug and $Net::SFTP::Foreign::debug & 4
3467 0 0 if ($self->_check and $sftp)
3507 0 0 if $Net::SFTP::Foreign::debug and $Net::SFTP::Foreign::debug & 4
3509 0 0 if ($self->_check and $sftp)