这个例子用来清理VC工程目录下的临时文件
#scp
#切换到英文关键字模式
#scpeng
#定义文件遍历回调函数
define:function,fileclean,filepathname
define:regexp,regexpstring,"\\.(aps|idb|ncp|obj|pch|sbr|tmp|pdb|bsc|ilk|res|ncb|opt|suo|manifest|dep|sdf|ipch|tlog|user|unsuccessfulbuild|log|lastbuildstate)$"
define:int,ret,0
match:regexp,regexpstring,filepathname,ret
test:ret==1,show:filepathname
#test:ret==1
#show:filepathname
#delete:filepathname
#end
end
#定义目录遍历回调函数
define:function,dirprocess,dirname
#show:dirname
open:directory,mysubdir1,dirname
enum:file,mysubdir1,allsubdirfiles
enum:subdirectory,mysubdir1,subsubdirs
traverse:allsubdirfiles,fileclean
traverse:subsubdirs,dirprocess
end
#定义主函数
define:function,main
open:directory,dir1,"I:\\ScriptEngine"
enum:file,dir1,allfiles
enum:subdirectory,dir1,subdirs
traverse:allfiles,fileclean
traverse:subdirs,dirprocess
end
本文介绍了一种通过脚本方式批量删除Visual C++工程项目中产生的各类临时文件的方法,包括定义了用于匹配特定类型文件的正则表达式及遍历目录进行清理的函数。
243

被折叠的 条评论
为什么被折叠?



