Discuss this help topic in SecureBlackbox Forum

SFTP: Request and set file attributes

The attributes can be requested either by reading the directory as described in the corresponding how-to article or using one of RequestAttributes() method of TElSimpleSFTPClient class. This method can accept either the handle of the file or directory, which has been previously opened using OpenFile() or OpenDirectory() method of TElSimpleSFTPClient class, or the absolute path to the file or directory (SFTP doesn't have a concept of "current directory").

Pass the reference to an instance of TElSftpFileAttributes class to RequestAttributes() method in Attributes parameter. Use FollowSymLinks parameter to specify whether the symlinks should be resolved to actual file or directory names. Information about the file attributes is provided in the corresponding how-to article.

The method is synchronous and returns when the data is retrieved.

To set the file or directory attibutes, use SetAttributes() or SetAttributesByHandle() methods of TElSimpleSFTPClient class.

First method accepts the absolute path to the file or directory (SFTP doesn't have a concept of "current directory"). Second method accepts the handle of the file or directory, which has been previously opened using OpenFile() or OpenDirectory() method of TElSimpleSFTPClient class.

Pass the reference to an instance of TElSftpFileAttributes class to the method in Attributes parameter. Remember to set IncludedAttributes property of TElSftpFileAttributes class to indicate, what attributes should be set. Information about the file attributes is provided in the corresponding how-to article.

The method is synchronous and returns when the operation is performed.

For information about error handling, see the corresponding how-to article.

Discuss this help topic in SecureBlackbox Forum