procedure Block(const Handle: TScSFTPFileHandle; Offset, Count: Int64; BlockModes: TScSFTPBlockModes);

 

Description

Call the Block method to create a byte-range lock on the file specified by the handle. 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).

If the NonBlocking property is set to True, then control is returned at once and you can learn the result of the operation execution by handling the OnSuccess and OnError events.

 

Note: This operation is supported starting with the version 6 of the SFTP protocol.

 

Parameters:

Handle - a handle returned by OpenFile or OpenDirectory methods. Note that some servers may return the SSH_FX_OP_UNSUPPORTED error if the handle is a directory handle.
Offset - the beginning of the byte-range to lock.
Count - 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.

 

See also

OnError

OnSuccess

OpenFile

UnBlock

 

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