mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 14:39:06 +02:00
Added CopyFile with PerserveTime parameter
git-svn-id: trunk@6078 -
This commit is contained in:
parent
19cd43bf63
commit
1cca3f8198
@ -187,6 +187,7 @@ function GetAllFilesMask: string;
|
|||||||
// file actions
|
// file actions
|
||||||
function ReadFileToString(const Filename: string): string;
|
function ReadFileToString(const Filename: string): string;
|
||||||
function CopyFile(const SrcFilename, DestFilename: string): boolean;
|
function CopyFile(const SrcFilename, DestFilename: string): boolean;
|
||||||
|
function CopyFile(const SrcFilename, DestFilename: string; PreserveTime: boolean): boolean;
|
||||||
function GetTempFilename(const Path, Prefix: string): string;
|
function GetTempFilename(const Path, Prefix: string): string;
|
||||||
|
|
||||||
procedure Register;
|
procedure Register;
|
||||||
@ -397,6 +398,9 @@ end.
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.30 2004/09/27 10:35:51 vincents
|
||||||
|
Added CopyFile with PerserveTime parameter
|
||||||
|
|
||||||
Revision 1.29 2004/09/01 09:43:24 mattias
|
Revision 1.29 2004/09/01 09:43:24 mattias
|
||||||
implemented registration of project file types
|
implemented registration of project file types
|
||||||
|
|
||||||
|
@ -930,6 +930,16 @@ end;
|
|||||||
function CopyFile(const SrcFilename, DestFilename: string): boolean;
|
function CopyFile(const SrcFilename, DestFilename: string): boolean;
|
||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
function CopyFile(const SrcFilename, DestFilename: string): boolean;
|
function CopyFile(const SrcFilename, DestFilename: string): boolean;
|
||||||
|
begin
|
||||||
|
result := CopyFile(SrcFilename, DestFilename, false);
|
||||||
|
end;
|
||||||
|
|
||||||
|
{------------------------------------------------------------------------------
|
||||||
|
function CopyFile(const SrcFilename, DestFilename: string PreserveTime:
|
||||||
|
boolean): boolean;
|
||||||
|
------------------------------------------------------------------------------}
|
||||||
|
function CopyFile(const SrcFilename, DestFilename: string; PreserveTime: boolean
|
||||||
|
): boolean;
|
||||||
var
|
var
|
||||||
SrcFS: TFileStream;
|
SrcFS: TFileStream;
|
||||||
DestFS: TFileStream;
|
DestFS: TFileStream;
|
||||||
@ -940,6 +950,8 @@ begin
|
|||||||
DestFS:=TFileStream.Create(DestFilename,fmCreate);
|
DestFS:=TFileStream.Create(DestFilename,fmCreate);
|
||||||
try
|
try
|
||||||
DestFS.CopyFrom(SrcFS,SrcFS.Size);
|
DestFS.CopyFrom(SrcFS,SrcFS.Size);
|
||||||
|
if PreserveTime then
|
||||||
|
FileSetDate(DestFS.Handle, FileGetDate(SrcFS.Handle));
|
||||||
finally
|
finally
|
||||||
DestFS.Free;
|
DestFS.Free;
|
||||||
end;
|
end;
|
||||||
@ -1056,6 +1068,9 @@ end;
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.50 2004/09/27 10:35:51 vincents
|
||||||
|
Added CopyFile with PerserveTime parameter
|
||||||
|
|
||||||
Revision 1.49 2004/09/01 09:43:24 mattias
|
Revision 1.49 2004/09/01 09:43:24 mattias
|
||||||
implemented registration of project file types
|
implemented registration of project file types
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user