|
@@ 674-682 (lines=9) @@
|
| 671 |
|
@reset($result); |
| 672 |
|
foreach ( $result as $entry ) { |
| 673 |
|
debug("ftp: file path = (".$entry["path"].")"); |
| 674 |
|
if ($cmd!=="NLST") { |
| 675 |
|
$data=ftp_GenListEntry($entry); |
| 676 |
|
echo "$data"; |
| 677 |
|
} else { |
| 678 |
|
$parent = $FTP->store->make_path($entry["path"], ".."); |
| 679 |
|
$filename = $entry["path"] ? substr($entry["path"], strlen($parent), -1) : $entry["filename"]; |
| 680 |
|
debug("ftp::nlst ".$filename); |
| 681 |
|
echo $filename."\n"; |
| 682 |
|
} |
| 683 |
|
} |
| 684 |
|
|
| 685 |
|
ftp_CloseDC(); |
|
@@ 701-708 (lines=8) @@
|
| 698 |
|
if (is_array($result)) { |
| 699 |
|
ftp_Tell(150, "Opening ".(($FTP->DC["type"]==="A") ? 'ASCII' : 'BINARY')." mode data connection"); |
| 700 |
|
if (ftp_OpenDC()!==false) { |
| 701 |
|
if ($cmd!=="NLST") { |
| 702 |
|
echo ftp_GenListEntry($result); |
| 703 |
|
} else { |
| 704 |
|
$parent = $FTP->store->make_path($result["path"], ".."); |
| 705 |
|
$filename = $result["path"] ? substr($result["path"], strlen($parent), -1) : $result["filename"]; |
| 706 |
|
debug("ftp::nlst ".$filename); |
| 707 |
|
echo $filename."\n"; |
| 708 |
|
} |
| 709 |
|
ftp_CloseDC(); |
| 710 |
|
ftp_Tell(226, "Transfer complete"); |
| 711 |
|
} else { |