Pascal Scripting: DelTree

Prototype:

function DelTree(const Path: String; const IsDir, DeleteFiles, DeleteSubdirsAlso: Boolean): Boolean;

Description:

Deletes the specified directory if IsDir is set to True, or files/directories matching a wildcard if IsDir is set to False. Returns True if it was able to successfully remove everything.

If DeleteFiles is set to True, files inside the specified directory will be deleted if IsDir is True, or files matching the specified wildcard (including those with hidden, system, and read-only attributes) will be deleted if IsDir is False.

If DeleteFiles and DeleteSubdirsAlso are both set to True, subdirectories (and their contents) will be deleted in addition to files.

Remarks:

This function will remove directories that are reparse points, but it will not recursively delete files/directories inside them.

Example:
begin
// Delete the directory C:\Test and everything inside it
DelTree('C:\Test', True, True, True); // Delete files matching C:\Test\*.tmp
DelTree('C:\Test\*.tmp', False, True, False); // Delete all files and directories inside C:\Test
// but leave the directory itself
DelTree('C:\Test\*', False, True, True);
end;

Inno Setup 删除文件夹 DelTree的更多相关文章

  1. PHP遍历、删除文件夹中的所有文件

    <?php header("Content-type:text/html;charset=utf-8"); /** * getDirFile 遍历文件夹中的所有文件 * @p ...

  2. 删除文件夹工具【fuckwinfsdel】,如 node_modules

    强力删除文件夹. 安装 npm install fuckwinfsdel -g 使用 fuckwinfsdel youdir 例 fuckwinfsdel node_modules 项目地址 http ...

  3. linux下删除文件夹的命令

    使用rm -rf 目录名字 命令即可 -r 就是向下递归,不管有多少级目录,一并删除-f 就是直接强行删除,不作任何提示的意思 eg 删除文件夹实例:rm -rf /var/log/httpd/acc ...

  4. python 实现彻底删除文件夹和文件夹下的文件

    python 中有很多内置库可以帮忙用来删除文件夹和文件,当面对要删除多个非空文件夹,并且目录层次大于3层以上时,仅使用一种内置方法是无法达到彻底删除文件夹和文件的效果的,比较low的方式是多次调用直 ...

  5. ios 下创建,删除文件夹的方法

    NSString *imageDir = [NSString stringWithFormat:@"%@/Caches/%@", NSHomeDirectory(), dirNam ...

  6. iOS创建、删除文件夹、获取沙盒路径

    1.获取沙盒路径 // 获取沙盒路径 NSString *documentsDirectory = [NSHomeDirectory() stringByAppendingPathComponent: ...

  7. 【File】递归删除文件夹中子级文件/夹,并删除文件夹

    今天有这样一个需求,需要删除某一个文件夹,但是文件夹中还有子级的文件 或者还可能会有文件夹在里面,所以就需要使用一个简单的递归才能将文件夹删除成功,包括文件夹中的子级文件/夹.!!! 其实很简单,就一 ...

  8. Linux 删除文件夹和文件命令

    inux删除目录很简单,很多人还是习惯用rmdir,不过一旦目录非空,就陷入深深的苦恼之中,现在使用rm -rf命令即可.直接rm就可以了,不过要加两个参数-rf 即:rm -rf 目录名字-r 就是 ...

  9. Java删除文件夹和文件

    转载自:http://blog.163.com/wu_huiqiang@126/blog/static/3718162320091022103144516/ 以前在javaeye看到过关于Java操作 ...

随机推荐

  1. Educational Codeforces Round 84 (Rated for Div. 2)

    A. Sum of Odd Integers(思维) 思路 这一题看完ans之后觉得是真简单,不过有一些地方还是要理解的. 这一题输出YES,有两个条件 kk%2 == n%2k,这个条件的意思是 k ...

  2. Oracle ROWNUM用法

    很多朋友应该跟我一样有个疑问,为什么rownum > 5 的时候会查不到一条数据,用rownum < 5就可以查到数据,明明查询所有的时候rownum有很多啊,小朋友,你是不是有很多问号? ...

  3. 使用IDEA编写JDBC

    省去下载MySQL的过程,创建数据库demo 首先在下载的Java服务中将此jar包复制到项目中的一个空文件夹中 在当前工程下新建目录lib(名字可自定) 找到MySQL的Java服务的jar包 打开 ...

  4. Xcode - 添加文档注释插件

    Xcode自动添加文档注释插件: https://github.com/onevcat/VVDocumenter-Xcode 功能演示: 感谢onevcat的分享!

  5. SHTC3温湿度传感器的使用

    1.SHTC3简单说明 SHTC3是一个检测温度.湿度的传感器,可以检测-40℃~125℃的温度范围和0%~100%的湿度范围. SHTC3的工作电压范围为:1.62V~3.6V. SHTC3使用的通 ...

  6. eclipse项目导入和导出

    导入导出过程这里推荐一下一篇他人的文章: https://blog.csdn.net/qq_41937388/article/details/87073572 注意: 1.导入第3步中,如果你的项目已 ...

  7. ssm整合简单例子

    1.首先新建一个maven项目 2.在pom.xml文件中加入以下代码引入包 <properties> <project.build.sourceEncoding>UTF-8& ...

  8. Python常见数据结构-Dictionary字典

    字典基本特点 字典的每个键值 key=>value 对用冒号 : 分割,每个键值对之间用逗号 , 分割,整个字典包括在花括号 {} 中. 键是唯一的,如果重复最后的一个键值对会替换前面的,值不需 ...

  9. ubuntu core文件

    ubuntu开启core 检查是否开启core ulimit -c //0表示没有开启 开启core ulimit -c unlimited sudo sh -c 'echo 1 > /proc ...

  10. mysql的事务四个特性以及事务的四个隔离级别

    一.事务四大属性 分别是原子性.一致性.隔离性.持久性. 1.原子性(Atomicity) 原子性是指事务包含的所有操作要么全部成功,要么全部失败回滚,因此事务的操作如果成功就必须要完全应用到数据库, ...