note 53854 modified in ref.ssh2 by bjori
| From: | bjori@php.net | Date: | Sat, 25 Mar 2006 10:48:49 +0000 |
| Subject: | note 53854 modified in ref.ssh2 by bjori | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-106566@lists.php.net to get a copy of this message | ||
To scan directorories with SFTP
<?php
$conn = ssh2_connect("localhost", 22);
// use any of the ssh2_auth_* methods
ssh2_auth_password($conn,"username", "password");
$sftp = ssh2_sftp($conn);
$dir = "ssh2.sftp://$sftp/var/log/";
while (($file = readdir($dh)) !== false) {
echo "$file\n";
}
closedir($dh);
?>
--was--
To scan directorories with SFTP
<?php
$conn = ssh2_connect("localhost", 22);
$sftp = ssh2_sftp($conn);
$dir = "ssh2.sftp://$sftp/var/log/";
while (($file = readdir($dh)) !== false) {
echo "$file\n";
}
closedir($dh);
?>
http://php.net/manual/en/ref.ssh2.php