From 1cc8b8d00863b25f1702697dc1b8a9bc2bbd47ac Mon Sep 17 00:00:00 2001 From: michael Date: Sun, 28 Nov 2010 17:52:12 +0000 Subject: [PATCH] * Implemented SimpleFileCOpy, fixes #14140 git-svn-id: trunk@28544 - --- .../projecttemplates/projecttemplates.pp | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/components/projecttemplates/projecttemplates.pp b/components/projecttemplates/projecttemplates.pp index 6d5c158f49..ee29dbe297 100644 --- a/components/projecttemplates/projecttemplates.pp +++ b/components/projecttemplates/projecttemplates.pp @@ -143,8 +143,27 @@ end; Function SimpleFileCopy(Const Source,Dest : String) : Boolean; +Var + F1,F2 : TFileStream; + begin - Result:=True; + Result:=False; + try + F1:=TFileStream.Create(Source,fmOpenRead); + try + F2:=TFileStream.Create(Dest,fmCreate); + try + F2.CopyFrom(F1,0); + finally + F2.Free; + end; + finally + F1.Free; + end; + Result:=True; + except + // + end; end;