欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

php fread buffer问题

程序员文章站 2022-04-28 16:14:13
...
Here is a small code on how to read the folder and download all its files:

You can also resume this code to (it will not copy directories):

while (false !== ($file = readdir($dirHandle))){    if ($file == "." || $file == "..")        continue;    echo "Copying file: $file\n";    if(!ssh2_scp_recv($connection, $remoteDir . $file, $localDir . $file))        echo "Could not download: ", $remoteDir, $file, "\n";}

If you do not use the full path on the remote folder it will not work:

opendir("ssh2.sftp://{$stream}{$remoteDir}")