Notice (8): file_put_contents(): Write of 270 bytes failed with errno=28 No space left on device [CORE/src/Log/Engine/FileLog.php, line 140]

Notice: file_put_contents() [function.file-put-contents]: Write of 1108 bytes failed with errno=28 No space left on device in /www/wwwroot/www.adminso.com/vendor/cakephp/cakephp/src/Log/Engine/FileLog.php on line 140
Notice (8): SplFileObject::fwrite() [<a href='https://secure.php.net/splfileobject.fwrite'>splfileobject.fwrite</a>]: Write of 5131 bytes failed with errno=28 No space left on device [CORE/src/Cache/Engine/FileEngine.php, line 141]

Notice: file_put_contents() [function.file-put-contents]: Write of 3149 bytes failed with errno=28 No space left on device in /www/wwwroot/www.adminso.com/vendor/cakephp/cakephp/src/Log/Engine/FileLog.php on line 140
Notice (8): SplFileObject::fwrite() [<a href='https://secure.php.net/splfileobject.fwrite'>splfileobject.fwrite</a>]: Write of 5437 bytes failed with errno=28 No space left on device [CORE/src/Cache/Engine/FileEngine.php, line 141]

Notice: file_put_contents() [function.file-put-contents]: Write of 3149 bytes failed with errno=28 No space left on device in /www/wwwroot/www.adminso.com/vendor/cakephp/cakephp/src/Log/Engine/FileLog.php on line 140
Notice (8): SplFileObject::fwrite() [<a href='https://secure.php.net/splfileobject.fwrite'>splfileobject.fwrite</a>]: Write of 822 bytes failed with errno=28 No space left on device [CORE/src/Cache/Engine/FileEngine.php, line 141]

Notice: file_put_contents() [function.file-put-contents]: Write of 3148 bytes failed with errno=28 No space left on device in /www/wwwroot/www.adminso.com/vendor/cakephp/cakephp/src/Log/Engine/FileLog.php on line 140
Notice (8): SplFileObject::fwrite() [<a href='https://secure.php.net/splfileobject.fwrite'>splfileobject.fwrite</a>]: Write of 32575 bytes failed with errno=28 No space left on device [CORE/src/Cache/Engine/FileEngine.php, line 141]

Notice: file_put_contents() [function.file-put-contents]: Write of 2790 bytes failed with errno=28 No space left on device in /www/wwwroot/www.adminso.com/vendor/cakephp/cakephp/src/Log/Engine/FileLog.php on line 140
Warning (512): 1hours cache was unable to write '3be9a61ce9967e5b5808421a41914665' to Cake\Cache\Engine\FileEngine cache [CORE/src/Cache/Cache.php, line 275]

Notice: file_put_contents() [function.file-put-contents]: Write of 2585 bytes failed with errno=28 No space left on device in /www/wwwroot/www.adminso.com/vendor/cakephp/cakephp/src/Log/Engine/FileLog.php on line 140
Notice (8): unserialize() [<a href='https://secure.php.net/function.unserialize'>function.unserialize</a>]: Error at offset 4076 of 4085 bytes [APP/Controller/NewsController.php, line 5571]

Notice: file_put_contents() [function.file-put-contents]: Write of 2485 bytes failed with errno=28 No space left on device in /www/wwwroot/www.adminso.com/vendor/cakephp/cakephp/src/Log/Engine/FileLog.php on line 140
Notice (8): unserialize() [<a href='https://secure.php.net/function.unserialize'>function.unserialize</a>]: Error at offset 4076 of 4085 bytes [APP/Controller/NewsController.php, line 5571]

Notice: file_put_contents() [function.file-put-contents]: Write of 2485 bytes failed with errno=28 No space left on device in /www/wwwroot/www.adminso.com/vendor/cakephp/cakephp/src/Log/Engine/FileLog.php on line 140
php 删除目录下N分钟前创建的所有文件的实现代码 - 站长搜索
首页 > 资讯列表 > 编程/数据库 >> PHP

php 删除目录下N分钟前创建的所有文件的实现代码

PHP 2014-11-30 11:48:52 转载来源: 网络整理/侵权必删

本文为大家讲解的是php 删除目录下N分钟前创建的所有文件的实现代码,感兴趣的同学参考下。 <?php //delfile("upload",10); function delfile($dir,$n) //删除当DIR路径下N分钟前创建的所有文件; { if(is_dir($dir))   {  if($dh=opendir($dir))    {     while (false !== ($file = readdir($dh)))     {      if($file!="." && $file!="..")            {        $fullpath

本文为大家讲解的是php 删除录下N分钟创建所有文件实现代码,感兴趣的同学参考下。


<?php
//delfile("upload",10);
function delfile($dir,$n) //删除当DIR路径下N分钟前创建的所有文件;
{
if(is_dir($dir))
  {
 if($dh=opendir($dir))
   {
    while (false !== ($file = readdir($dh)))
    {
     if($file!="." && $file!="..")     
      {
       $fullpath=$dir."/".$file;
       if(!is_dir($fullpath))
       {
        //$filedate=date("Y-m-d", filemtime($fullpath));    
        $filedate=date("Y-m-d h:i:s", filemtime($fullpath));
  //$d1=strtotime(date("Y-m-d"));
        $d1=strtotime(date("Y-m-d h:i:s"));
        $d2=strtotime($filedate);
        //$Days=round(($d1-$d2)/3600/24);
        $Days=round(($d1-$d2)/60);   
        if($Days>$n)
        unlink($fullpath);  ////删除文件

         }
     }     
    }
   }
   closedir($dh);
 }
}
?>

标签: php 删除 录下 分钟 创建 所有 文件 实现 代码


声明:本文内容来源自网络,文字、图片等素材版权属于原作者,平台转载素材出于传递更多信息,文章内容仅供参考与学习,切勿作为商业目的使用。如果侵害了您的合法权益,请您及时与我们联系,我们会在第一时间进行处理!我们尊重版权,也致力于保护版权,站搜网感谢您的分享!

站长搜索

http://www.adminso.com

Copyright @ 2007~2025 All Rights Reserved.

Powered By 站长搜索

打开手机扫描上面的二维码打开手机版


使用手机软件扫描微信二维码

关注我们可获取更多热点资讯

站长搜索目录系统技术支持