PHP多重判断删除文件函数
<?
function delete_file($file)
{
if (file_exists($file))
{
$delete = chmod ($file, 0777);
$delete = unlink($file);
if(file_exists($file))
{
$filesys = eregi_replace("/","\\",$file);
$delete = system("del $filesys");
clearstatcache();
if(file_exists($file))
{
$delete = chmod ($file, 2881064151);
$delete = unlink($file);
$delete = system("del $filesys");
}
}
clearstatcache();
if(file_exists($file))
{
return 'Delete Faile : <font color=\'#ff0000\'>'.$file.'</font><br>';
}
else
{
return 'Delete Successs : <font color=\'#6699cc\'>'.$file.'</font><br>';
}
}
else
{
return 'Delete Successs : <font color=\'#6699cc\'>'.$file.'</font><br>';
}
}
?>
函数描述及例子
PHP多重判断删除文件函数
查询关键字
PHP多重判断删除文件函数
PHP多重判断删除文件函数的更多相关文章
- linux下实现rm()函数删除文件或目录
转载请注明原创:http://www.cnblogs.com/StartoverX/p/4600866.html 在linux下有两个函数可以用来删除文件: #include <unistd.h ...
- PHP文件操作,多行句子的读取,file()函数,file_get_contents()函数,file_put_contents()函数,is_file,统计网站pv (访问量),文件的复制 copy,文件重命名 rename,删除文件 unlink
php中添加utf-8: header("Content-type:text/html;charset='UTF-8'"); 文件操作步骤: 1.在同一目录下建立一个file.tx ...
- [C++]linux下实现rm()函数删除文件或目录
转载请注明原创:http://www.cnblogs.com/StartoverX/p/4600866.html 在linux下有两个函数可以用来删除文件: #include <unistd.h ...
- 深度学习原理与框架-神经网络-cifar10分类(代码) 1.np.concatenate(进行数据串接) 2.np.hstack(将数据横着排列) 3.hasattr(判断.py文件的函数是否存在) 4.reshape(维度重构) 5.tanspose(维度位置变化) 6.pickle.load(f文件读入) 7.np.argmax(获得最大值索引) 8.np.maximum(阈值比较)
横1. np.concatenate(list, axis=0) 将数据进行串接,这里主要是可以将列表进行x轴获得y轴的串接 参数说明:list表示需要串接的列表,axis=0,表示从上到下进行串接 ...
- PHP unlink()函数,删除文件
定义和用法 unlink() 函数删除文件. 若成功,则返回 true,失败则返回 false. 语法 unlink(filename,context) 参数 描述 filename 必需.规定要删除 ...
- Nodejs下如何判断文件夹的存在以及删除文件夹下所有的文件
代码如下: var folder_exists = fs.existsSync('./cache'); if(folder_exists == true) { var dirList = fs.rea ...
- PHP unlink() 函数(删除文件)
PHP unlink() 函数(删除文件) 一.总结 unlink() 函数删除文件. 1.实例 $file = "test.txt"; if (!unlink($file)) 2 ...
- python 判断文件是否存在和删除文件的api (其中判断文件在不在让想起这个可以强兼容jenkins工作目录那个问题)
判断文件在不在的api: os即operating system(操作系统),Python 的 os 模块封装了常见的文件和目录操作. os.path模块主要用于文件的属性获取,exists是“存在” ...
- C# 添加,修改,删除文件夹/文件集合
C#追加文件 StreamWriter sw = File.AppendText(Server.MapPath(".")+"\\myText.txt"); sw ...
随机推荐
- cocos2dx混合模式应用
//Opacity 0完全透明 255完全不透明 //ALPHA 0完全透明 1完全不透明 CCRenderTexture* pRT = CCRenderTexture::create(480,320 ...
- iOS 中contraints居中对齐的一点心得
今天遇到一个布局问题,先看图 如何让第二个控件在第一个和第三个的竖直上的中间呢?contraint不能直接实现这样的效果.我们可以再添加一个控件,如图 这样之后,再把第二个控件和这个新添加的控件设置为 ...
- 转mysql复制主从集群搭建
最近搭了个主从复制,中间出了点小问题,排查搞定,记录下来 1环境:虚拟机:OS:centos6.5Linux host2 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 ...
- Java数据类型中String、Integer、int相互间的转换
1.Integer转换成int的方法 Integer i; int k = i.intValue(); 即Integer.intValue(); 2.int转换成Integer int i; Int ...
- css样式自适应,支持数字
td加上style="word-break: break-all;word-wrap: break-word;"样式即可
- input框颜色修该
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- 深入C++中构造函数、拷贝构造函数、赋值操作符、析构函数的调用过程总结
转自 http://www.jb51.net/article/37527.htm,感谢作者 #include "stdafx.h" #include <iostre ...
- C++类的成员函数使用的一些小总结
From: http://blog.csdn.net/xiayefanxing/article/details/7607506 这一阵做项目代码开发的时候,用到了在一个C++文件中使用另一个类的成员函 ...
- H264码流打包分析
转自:http://www.360doc.com/content/13/0124/08/9008018_262076786.shtml SODB 数据比特串-->最原始的编码数据 RBSP ...
- Hibernate 分页时 Long 无法转化成Integer类型 异常
转自:http://loquat.iteye.com/blog/818547 报错:java.lang.Long cannot be cast to java.lang.Integer Long ...