Discuss this help topic in SecureBlackbox Forum

TElSimpleSFTPClient.Block

TElSimpleSFTPClient     See also     


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


Creates a byte-range lock on the file

Declaration

[C#/Java]
    void Block(byte[] Handle, long Offset, long Length, TSBSftpFileOpenAccess LockMask);

[VB.NET]
    Sub Block(ByVal Handle As Byte(), ByVal Offset As Long, ByVal Length As Long, ByVal LockMask As TSBSftpFileOpenAccess)

[Pascal]
    function Block(const Handle: TSBSftpFileHandle; Offset, Length : Int64; LockMask : TSBSftpFileOpenAccess) : boolean;
    procedure BlockSync(const Handle: TSBSftpFileHandle; Offset, Length : Int64; LockMask : TSBSftpFileOpenAccess);
    
    TSBSftpFileHandle = ByteArray;
    TSBSftpFileOpenAccess = set of TSBSftpFileOpenAccessItem;

[C++]
    void Block(const std::vector<uint8_t> &Handle, int64_t Offset, int64_t Length, TSBSftpFileOpenAccess LockMask);

[PHP]
    void Block(array of byte|string|NULL $Handle, integer $Offset, integer $Length, integer $LockMask)

Parameters

  • Handle - handle of the open file
  • Offset - beginning of the byte-range to lock.
  • Length - number of bytes in the range to lock. The special value 0 means lock from Offset to the end of the file.
  • LockMask - flags managing blocking process

LockMask values:


TSBSftpFileOpenAccess values

Return value

    True if operation was completed successfully;
    False otherwise.

Description

    Use this method to create a byte-range lock on the file specified by the handle.
    In case of error, EElSFTPError exception containing SFTP error code, is raised. For more information on error handling, please read the corresponding how-to article.

See also:     Unblock    

Discuss this help topic in SecureBlackbox Forum