TScSFTPServerBlockFileEvent = procedure(Sender: TObject; SFTPSessionInfo: TScSFTPSessionInfo; Data: TObject; const Offset, Len: Int64; const BlockModes: TScSFTPBlockModes; var Error: TScSFTPError) of object;


property OnBlockFile: TScSFTPServerBlockFileEvent;



The OnBlockFile event occurs on request from an SFTP client to create a byte-range lock on a file specified by the Data object. The lock can be either mandatory (the server enforces that no other process or client can perform operations violating the lock) or advisory (no other processes can obtain a conflicting lock, but the server does not enforce that no operation violates the lock).

You can call the DefaultBlockFile 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 blocking 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 - zero-based byte offset in the file that indicates the beginning of the byte-range to lock.
Len - the number of bytes in the range to lock. The special value 0 means a lock from Offset to the end of the file.
BlockModes - the blocking mode.
Error - a parameter to pass the information about an error that can arise when blocking a file.


See also


SecureBridge Components, Copyright © 2007-2021 Devart. All Rights Reserved. Provide Feedback Visit Forum Request Support