mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-28 21:00:43 +02:00
fixed backuping symlinks
git-svn-id: trunk@3730 -
This commit is contained in:
parent
5aae7c3e96
commit
3137dd2f7b
@ -46,7 +46,7 @@ interface
|
||||
{$endif}
|
||||
|
||||
uses
|
||||
SysUtils, Classes, FileProcs, IDEProcs;
|
||||
SysUtils, Classes, FileCtrl, IDEProcs;
|
||||
|
||||
{ Config Path Functions }
|
||||
|
||||
@ -78,6 +78,9 @@ end.
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.10 2002/12/23 13:20:45 mattias
|
||||
fixed backuping symlinks
|
||||
|
||||
Revision 1.9 2002/12/20 11:08:47 mattias
|
||||
method resolution clause, class ancestor find declaration, 1.1. makros
|
||||
|
||||
|
@ -37,7 +37,7 @@ unit ProjectDefs;
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, Laz_XMLCfg, IDEProcs, SynRegExpr, FileProcs;
|
||||
Classes, SysUtils, Laz_XMLCfg, IDEProcs, SynRegExpr, FileCtrl;
|
||||
|
||||
type
|
||||
TOnLoadSaveFilename = procedure(var Filename:string; Load:boolean) of object;
|
||||
|
@ -69,6 +69,7 @@ function ChompPathDelim(const Path: string): string;
|
||||
function TrimFilename(const AFilename: string): string;
|
||||
function CleanAndExpandFilename(const Filename: string): string;
|
||||
function CleanAndExpandDirectory(const Filename: string): string;
|
||||
function CopyFile(const SrcFilename, DestFilename: string): boolean;
|
||||
|
||||
// file search
|
||||
function SearchFileInPath(const Filename, BasePath, SearchPath,
|
||||
@ -108,6 +109,9 @@ end.
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.9 2002/12/23 13:20:46 mattias
|
||||
fixed backuping symlinks
|
||||
|
||||
Revision 1.8 2002/12/23 10:12:40 mattias
|
||||
added symlink test and unit types
|
||||
|
||||
|
@ -583,6 +583,32 @@ begin
|
||||
Result:=AppendPathDelim(CleanAndExpandFilename(Filename));
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
function CopyFile(const SrcFilename, DestFilename: string): boolean;
|
||||
------------------------------------------------------------------------------}
|
||||
function CopyFile(const SrcFilename, DestFilename: string): boolean;
|
||||
var
|
||||
SrcFS: TFileStream;
|
||||
DestFS: TFileStream;
|
||||
begin
|
||||
try
|
||||
SrcFS:=TFileStream.Create(SrcFilename,fmOpenRead);
|
||||
try
|
||||
DestFS:=TFileStream.Create(DestFilename,fmCreate);
|
||||
try
|
||||
DestFS.CopyFrom(SrcFS,SrcFS.Size);
|
||||
finally
|
||||
DestFS.Free;
|
||||
end;
|
||||
finally
|
||||
SrcFS.Free;
|
||||
end;
|
||||
Result:=true;
|
||||
except
|
||||
Result:=false;
|
||||
end;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
function SearchFileInPath(const Filename, BasePath, SearchPath,
|
||||
Delimiter: string; SearchLoUpCase: boolean): string;
|
||||
@ -674,6 +700,9 @@ end;
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.8 2002/12/23 13:20:46 mattias
|
||||
fixed backuping symlinks
|
||||
|
||||
Revision 1.7 2002/12/23 10:12:40 mattias
|
||||
added symlink test and unit types
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user