ファイルをコピー
ファイルをコピーします。
function fnCopyFile(strBfreFilePath:string; strAftrFilePath:string):boolean;
var
RS:TResourceStream;
begin
result := False;
if fnCreateFolder(fnGetFolderPathByFilePath(strAftrFilePath)) then begin
try
if FileExists(strBfreFilePath) then begin
result := CopyFile(Pchar(strBfreFilePath),Pchar(strAftrFilePath),False);
end;
except
result := False;
end;
end;
end;
function fnCreateFolder(strFolderPath:string):boolean;
begin
if fnFolderExists(strFolderPath) then begin
fnCreateFolder := True;
end else begin
fnCreateFolder := ForceDirectories(strFolderPath);
end;
end;