Discuss this help topic in SecureBlackbox Forum

TElSimpleSFTPClient.Block

TElSimpleSFTPClient     See also     


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


Creates a byte-range lock on the file

Declaration

[C#]
    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]
    procedure Block(const Handle : TSBSftpFileHandle; Offset, Length : Int64; LockMask : TSBSftpFileOpenAccess);

[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)

[Java]
    void block(byte[] Handle, long Offset, long Length, TSBSftpFileOpenAccess 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