我将参数值'*1.dat'
传递给FindFirst,仍然是FindFirst()例程返回的第一个文件是46checks5.dat
,它非常一致。为什么FindFirst返回与掩码不匹配的文件名?
这是一个已知的问题?
vpath:=trim(vpath);
result:=true;
try
res:=findfirst(vpath+'\'+vmask,faarchive,search); //vmask = *1.dat
try
while res=0 do
begin
vlist.add(search.name); //searchname returned is 46checks5.dat!!!
res:=findnext(search);
end;
finally
findclose(search);
end;
except
result:=false;
end;
我创建了三个文件(461checksa1.dat,46checks1.dat,46checksa1.dat,46checks5.dat)并使用您的代码,每个文件都显示在备忘录中,包括最后一个没有'1'在文件名中! – 2011-04-15 17:43:48
对不起,我的意思是我创建了四个文件(其中一个在名称中缺少'1') – 2011-04-15 17:48:41