API:System.Classes.TBufferedFileStream.SetSize
Delphi
procedure SetSize(const NewSize: Int64); override;
C++
virtual void __fastcall SetSize(const __int64 NewSize)/* overload */;
inline void __fastcall SetSize(int NewSize){ THandleStream::SetSize(NewSize); }
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
procedure function |
protected | System.Classes.pas System.Classes.hpp |
System.Classes | TBufferedFileStream |
Description
Sets the end of the file marker to truncate the resource at the indicated position.
System.Classes.TBufferedFileStream.SetSize inherits from System.Classes.THandleStream.SetSize. All content below this line refers to System.Classes.THandleStream.SetSize.
Sets the end of the file marker to truncate the resource at the indicated position.
Call SetSize to set the size of the resource. SetSize calls Seek to go to the indicated position, and then writes an end of file marker. If the size of the resource cannot be changed, an exception is raised. For example, calling SetSize for a file handle that was opened in fmOpenRead mode will raise an exception.