note 53854 deleted from ref.ssh2 by bjori
| From: | bjori@php.net | Date: | Mon, 27 Mar 2006 09:37:14 +0000 |
| Subject: | note 53854 deleted from ref.ssh2 by bjori | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-106699@lists.php.net to get a copy of this message | ||
Note Submitter: alex at tortilla dot ru
----
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);
?>