System.Classes.THandleStream.Handle
Delphi
property Handle: THandle read FHandle;
C++
__property NativeUInt Handle = {read=FHandle, nodefault};
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
property | public | System.Classes.pas System.Classes.hpp |
System.Classes | THandleStream |
Description
Specifies the handle for the communications resource the stream reads from and writes to.
Read Handle to get the handle for file management functions. To read from or write to the resource, use the methods of the THandleStream object.
Handle is a read-only property. The handle property cannot be changed to allow the handle stream to switch from reading to writing or vice versa. For example, to change from a file handle that is opened in read-only mode to one that is opened in write mode:
- Free the stream object.
- Call FileClose to close the file.
- Reopen the file in write mode and use the handle to create a new instance of a handle stream. Alternately, open a TFileStream object for the file, specifying a write mode for the stream.
Note: Do not call the FileClose function on the Handle until after the THandleStream object has been destroyed.