Discuss this help topic in SecureBlackbox Forum

TElSFTPServer.OnReadFile

TElSFTPServer     See also     


Filter: C#  VB.NET  Pascal  C++  PHP  Java  


This event is fired when your software has to read the data from the file.

Declaration

[C#]
    event TElSFTPServerReadEvent OnReadFile;
    delegate void TElSFTPServerReadEvent(Object Sender, Object Data, long Offset, ref byte[] Buffer, int BufferOffset, int Count, ref int Read, ref int ErrorCode, ref string Comment);

[VB.NET]
    Event OnReadFile As TElSFTPServerReadEvent
    Delegate Sub TElSFTPServerReadEvent(ByVal Sender As Object, ByVal Data As Object, ByVal Offset As Long, ByRef Buffer As Byte(), ByVal BufferOffset As Integer, ByVal Count As Integer, ByRef Read As Integer, ByRef ErrorCode As Integer, ByRef Comment As String)

[Pascal]
    property OnReadFile: TSBSFTPServerReadEvent;
    TSBSFTPServerReadEvent = procedure(Sender : TObject; const Data: pointer; Offset : Int64; Buffer : Pointer; Count : integer; var Read : integer; var ErrorCode : integer; var Comment : string) of object;

[C++]
    void get_OnReadFile(TElSFTPServerReadEvent &pMethodOutResult, void * &pDataOutResult);
    void set_OnReadFile(TElSFTPServerReadEvent pMethodValue, void * pDataValue);
    typedef void (SB_CALLBACK *TElSFTPServerReadEvent)(void * _ObjectData, TObjectHandle Sender, void * Data, int64_t Offset, void * Buffer, int32_t Count, int32_t &Read, int32_t &ErrorCode, char * pcComment, int32_t &szComment);

[PHP]
    TElSFTPServerReadEvent|callable|NULL get_OnReadFile()
    void set_OnReadFile(TElSFTPServerReadEvent|callable|NULL $Value)
    callable TElSFTPServerReadEvent(TObject $Sender, TSBPointer|NULL $Data, integer $Offset, TSBPointer|NULL $Buffer, integer $Count, integer &$Read, integer &$ErrorCode, string &$Comment)

[Java]
    TElSFTPServerReadEvent getOnReadFile();
    void setOnReadFile(TElSFTPServerReadEvent Value);
    TElSFTPServerReadEvent.Callback OnReadFile = new TElSFTPServerReadEvent.Callback() {
        public void TElSFTPServerReadEventCallback(TObject arg0, TObject arg1, long arg2, byte[] arg3, int arg4, int arg5, TSBInteger arg6, TSBInteger arg7, TSBString arg8) {
            //...
        }
    }

Parameters

  • Data - user data associated with the opened file
  • Offset - position from which the file is read
  • Buffer - buffer that contains read data
  • BufferOffset - start position in the buffer from which the data must be read
  • Count - amount of bytes to be read
  • Read - amount of bytes have been actually read
  • ErrorCode - the error code, see values below
  • Comment - server comment
  • pcComment - server comment
  • szComment - the length of pcComment.

Error codes values:

Description

    This event is fired when the file contents must be read and sent to the client.
The application can return the error code in ErrorCode parameter and textual comment in Comment parameter.

See also:     OnOpenFile     OnRenameFile     OnRemove     OnWriteFile     OnReadSymLink    

Discuss this help topic in SecureBlackbox Forum