已掉线,重新登录

首页 > 绿虎论坛 > 历史版块 > 编程 > PHP > 源码

标题: 求助,谁可以帮写一个批量删除后缀为.bak文件的php

作者: @Ta

时间: 2012-01-12

点击: 1672

老虎的那个在我空间使用要出错,
Warning : include(css.php) [ function.include ]: failed to open stream: No such file or directory in D:\vip\chen9818\web\******\ubb.php online 6
Warning : include() [ function.include ]: Failed opening 'css.php' for inclusion (include_path='.;C:\php5\pear')in D:\vip\chen9818\web\******\ubb.php online 6
(上面是进去时是这样的)
下面是提交过后
Warning : readdir(): supplied argument is not a valid Directory resource in D:\vip\chen9818\web\******\delbak.php on line 15
Warning : readdir(): supplied argument is not a valid Directory resource in D:\vip\chen9818\web\******\delbak.php on line 16
Warning : readdir(): supplied argument is not a valid Directory resource in D:\vip\chen9818\web\******\delbak.php on line 17
Warning : include(css.php) [ function.include ]: failed to open stream: No such file or directory in D:\vip\chen9818\web\******\ubb.php online 6
Warning : include() [ function.include ]: Failed opening 'css.php' for inclusion (include_path='.;C:\php5\pear')in D:\vip\chen9818\web\******\ubb.php online 6

[隐藏样式|查看源码]


『回复列表(3|显示机器人聊天)』

1. 未涉猎
(/@Ta/2012-01-12 10:58//)

2. 请别乱删除文件!放在任意目录,它将遍历该目录下文件,并删除.bak文件
<?php
function scan($dir){
foreach(glob($dir.'/*') as $i){
if(is_file($i) AND end(explode('.',$i))=='bak') unlink($i);

if(is_dir($i)) scan($i);

}}
scan('.');
?>
(/@Ta/2012-01-12 13:12//)

3. 谢谢风车
(/@Ta/2012-01-12 14:39//)

回复需要登录

9月30日 09:39 星期二

本站由hu60wap6驱动

备案号: 京ICP备18041936号-1