implemented broken dependencies dialog

git-svn-id: trunk@3409 -
This commit is contained in:
mattias 2002-10-01 15:45:39 +00:00
parent d4d9be12c6
commit 8f9ea479eb

View File

@ -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