压缩后删除原始文件 [英] delete original files after zipping

查看:135
本文介绍了压缩后删除原始文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的结构下面有很多文件:

主文件夹 - > sample1

子文件夹 - > sub1

另一个子文件夹 - > sub2

另一个子文件夹 - > sub3

i have lot of files below structure:
main folder->sample1
sub folder->sub1
another sub folder->sub2
another sub folder->sub3

推荐答案

这就是您的全部需求:

http://php.net/manual/en/ function.delete.php [ ^ ],

http://www.php.net/manual/en/ function.unlink.php [ ^ ]。



不要与名称 unlink 混淆。此调用确实删除了一个文件。如果您创建了多个硬链接(我简直不敢相信),根据传递的文件名,只会删除一个。



硬链接(以及软链接)链接)由所有Unix文件系统支持,但也由NTFS和Windows支持;太糟糕了,没有太多的开发人员知道它并使用这个事实。



-SA
This is all your need:
http://php.net/manual/en/function.delete.php[^],
http://www.php.net/manual/en/function.unlink.php[^].

Don't be confused with the name unlink. This call really deletes a file. If you created multiple hard links (I can hardly believe that), only one will be deleted, according to the file name passed.

Hard links (as well as soft links) are supported by all Unix file systems, but also by NTFS and Windows; too bad not too many developers are aware of it and use this fact.

—SA


这篇关于压缩后删除原始文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆