end;
2.2删除目录的函数:DeleteDir
function DeleteDir(sDirName:String):Boolean;
begin
if Length(sDirName)< =0 then
exit;
//删除
Result:=DoRemoveDir(sDirName) and RemoveDir(sDirName);
end;
3、移动目录
有了拷贝目录和删除目录的函数,移动目录就变得很简单,只需顺序调用前两个函数即可:
function MoveDir(sDirName:String;
sToDirName:string):Boolean;
begin
if CopyDir(sDirName
sToDirName) then
if RemoveDir(sDirName) then
result:=True
else
result:=false;
end;