我用该函数来复制一个目录的文件到 另外一个目录(为了便与控制 没有用文件夹操作函数)
为什么在cd-r 光盘中该函数失效 找不到文件啊 
根据我估计有可能有两个原因 因为文件为只读
第二个光驱速度跟不上 太差function tform1.DoCopyDir(sDirName:String;sToDirName:String):Boolean;
var
hFindFile:Cardinal;
t,tfile:String;
sCurDir:String[255];
FindFileData:WIN32_FIND_DATA;
h:integer;
begin
sCurDir:=GetCurrentDir;       //先保存当前目录
ChDir(sDirName);
hFindFile:=FindFirstFile('*.*',FindFileData);if hFindFile<>INVALID_HANDLE_VALUE then  //找到文件或目录
  begin
if not DirectoryExists(sToDirName) then
ForceDirectories(sToDirName);
repeat
tfile:=FindFileData.cFileName;
if (tfile='.') or (tfile='..') then Continue;
if FindFileData.dwFileAttributes=FILE_ATTRIBUTE_DIRECTORY then
//查找到目录继续递归
begin
t:=sToDirName+'\'+tfile;
if not DirectoryExists(t) then ForceDirectories(t);
if sDirName[Length(sDirName)]<> '\' then
DoCopyDir(sDirName+'\'+tfile,t)
else
DoCopyDir(sDirName+tfile,sToDirName+tfile);
end
else
//否则拷贝文件
begin
t:=sToDirName+'\'+tFile;
count:=count+1;
 bar.StepIt;
label2.Caption:='正在复制文件'+tfile+'...';
label2.Update;
application.ProcessMessages;
CopyFile(PChar(tfile),PChar(t),True);
end;
until FindNextFile(hFindFile,FindFileData)=false;
windows.FindClose(hFindFile);
  end
else
  begin
ChDir(sCurDir);
result:=false;
exit;
  end;
ChDir(sCurDir);      //回到原来的目录下
result:=true;
end;