mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-16 04:59:25 +02:00
parent
18fdc0675e
commit
74e65f77bc
@ -1243,7 +1243,10 @@ end;
|
||||
Procedure THandleStream.SetSize(const NewSize: Int64);
|
||||
|
||||
begin
|
||||
FileTruncate(FHandle,NewSize);
|
||||
// We set the position afterwards, because the size can also be larger.
|
||||
if not FileTruncate(FHandle,NewSize) then
|
||||
Raise EInOutError.Create(SStreamSetSize);
|
||||
Position:=NewSize;
|
||||
end;
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user