L脚本语言 写一个清理VC工程目录的脚本

来源:互联网 发布:淘宝图片轮播制作 编辑:程序博客网 时间:2024/05/22 06:10

这个例子用来清理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




0 0
原创粉丝点击