mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-27 20:00:47 +02:00
implemented broken dependencies dialog
git-svn-id: trunk@3409 -
This commit is contained in:
parent
d4d9be12c6
commit
8f9ea479eb
@ -75,6 +75,7 @@ const
|
||||
|
||||
// files
|
||||
function BackupFile(const Filename, BackupFilename: string): boolean;
|
||||
function ClearFile(const Filename: string; RaiseOnError: boolean): boolean;
|
||||
function CompareFilenames(const Filename1, Filename2: string): integer;
|
||||
function CompareFilenames(const Filename1, Filename2: string;
|
||||
ResolveLinks: boolean): integer;
|
||||
@ -666,6 +667,29 @@ begin
|
||||
Result:=true;
|
||||
end;
|
||||
|
||||
{-------------------------------------------------------------------------------
|
||||
function ClearFile(const Filename: string; RaiseOnError: boolean): boolean;
|
||||
-------------------------------------------------------------------------------}
|
||||
function ClearFile(const Filename: string; RaiseOnError: boolean): boolean;
|
||||
var
|
||||
fs: TFileStream;
|
||||
begin
|
||||
if FileExists(Filename) then begin
|
||||
try
|
||||
fs:=TFileStream.Create(Filename,fmOpenWrite);
|
||||
fs.Size:=0;
|
||||
fs.Free;
|
||||
except
|
||||
on E: Exception do begin
|
||||
Result:=false;
|
||||
if RaiseOnError then raise;
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
Result:=true;
|
||||
end;
|
||||
|
||||
{-------------------------------------------------------------------------------
|
||||
TabsToSpaces
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user