TScSFTPServerReadFileEvent = procedure(Sender: TObject; SFTPSessionInfo: TScSFTPSessionInfo; Data: TObject; Offset: Int64; Count: cardinal; var Buffer: TBytes; var Read: cardinal; var Error: TScSFTPError) of object;
property OnReadFile: TScSFTPServerReadFileEvent;
The OnReadFile event occurs on request from an SFTP client to read data of file specified by the Data object. The OnReadFile event handler should return the erEof error if the end of file was reached.
You can call the DefaultReadFile method to execute this operation or write your own implementation.
|•||Sender - the object whose event handler is called.|
|•||SFTPSessionInfo - contains the information about the current SFTP session.|
|•||Data - specifies the information about a reading file as the TScHandle object or any user's object. Usually this object is previously returned by the DefaultOpenFile method or the OnOpenFile event handler.|
|•||Offset - the offset in bytes relative to the beginning of the file that the read starts at. This parameter is ignored if TEXT MODE was specified during the open.|
|•||Count - the maximum number of bytes to read.|
|•||Buffer - the buffer to which the data should be read.|
|•||Read - a parameter to pass the amount of read data.|
|•||Error - a parameter to pass the information about an error that can arise when reading a file. The erEof error should be returned if the end of file was reached.|