Home > php教程 > PHP源码 > body text

php拷贝文件到相应目录

PHP中文网
Release: 2016-05-25 17:07:06
Original
1326 people have browsed it

php代码

<?php
$directory = dirname(__FILE__);//  /var/bigbluebutton
$iterator = new DirectoryIterator($directory);
foreach ($iterator as $fileinfo)
{
    $path = $fileinfo -> getFilename(); //目录名称
    if (!$fileinfo -> isDot() && $fileinfo -> isDir() && $fileinfo -> getMTime() > time()-5 * 60)
    {
        $cp = $directory . "/" . $path . "/" . $path;
        if (!is_dir($directory . $path . "/" . $path . "/L1"))
        {
            echo "not exits;";
            echo "cp /opt/pdfs/* " . $cp;
            system("cp -rf /opt/pdfs/* " . $cp); //将生成好了的pdf文件到/opt/pdfs
        } 
    } 
} 
?>
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template