fdir(path)
sss txt=""
//扫描文件夹路径,备注掉下一行则扫全盘
.ss(path+"/"+"kgmusic",path)
.ss(path+"/"+"zzz",path)
.syso(path)
t()
{
time(4,st1)
fn file.sysof(path)
//测试保存.mp3后缀文件的路径
fw("%mp3log.txt",sss.txt)
syso("ok")
time(4,end1)
s(end1-st1,bb1)
syso(bb1)
}
//以下代码放在file.myu
//判断是否空文件夹
fn length(path)
fi(path,fi)
f(fi){
fl(path,fle)
sgszl(fle,fileslength)
sss fileslength = fileslength
}else{
sss fileslength = -1
}
s fi = null
s fle = null
s fileslength = null
end fn
//递归扫描文件
fn sysof(dir)
//获取文件夹和文件个数,判断是否空文件夹
fn file.length(dir)
//定义不需要扫描的文件夹
fdir("%Android",fAndroid)
fdir("tencent",ftencent)
s fileslength = sss.fileslength
sss fileslength = null
syso(fileslength)
f(fileslength>0){
ss("查找"+dir+"中",sydir)
syso(sydir)
//获取路径下文件列表
fl(dir,fldir)
//获取文件夹名或文件名
for(apath;fldir){
//计算绝对路径
ss(dir+"/"+apath,Apath)
.fdir(Apath1,Apath)
//判断路径是否文件夹
fi(Apath,fipath)
f(!fipath){
ss("文件:"+Apath,ss)
syso(ss)
//记录指定后缀文件
f(ss*?".mp3"||ss*?".m4a"){
ss(sss.txt+"\n"+ss,sss.txt)
}
}else{
//apath为文件夹/文件名,Apath为绝对路径
f(Apath==fAndroid||Apath==ftencent||apath?*"."){
syso("跳过过滤文件")
}else{
fn file.sysof(Apath)
}
}
}
}else{
ss("目录:"+dir+"为空.",nofile)
syso(nofile)
}
end fn