Discuss this help topic in SecureBlackbox Forum

Work with attributes

File, directory and symlink attributes in SFTP classes of SecureBlackbox are accessed and manipulated using TElSftpFileAttributes class.

When you read the directory, the TElSftpFileAttributes class is present as Attributes property of TElSftpFileInfo class, which represents a directory entry. When you create a file or directory, or request file or directory attributes, you use an instance of TElSftpFileAttributes class directly.

TElSftpFileAttributes class contains some or all attributes, which are available for a file or directory. Note, that TElSftpFileInfo not necessarily contains all attributes, for which the properties exist. Some servers can't return or accept certain attributes due to their nature (for example, Windows servers can't return unix attributes and vice versa). Some other properties were introduced in recent versions of SFTP protocol (SFTP 5, SFTP 6), and so they are not effective, when the connection is established using older protocol versions.

You can check, what attributes were returned, or specify, what attributes have been set, using IncludedAttributes property of TElSftpFileAttributes class.

To retrieve or set the attributes of some particular file or directory use RequestAttributes and SetAttributes methods of your SFTP client (TElSFTPClient or TElSimpleSFTPClient). In both cases an instance of TElSftpFileAttributes class is passed as a parameter. This parameter is used as described above.

How To articles about SFTP client

Discuss this help topic in SecureBlackbox Forum