Back to product page
- Introduction
- Overview
- License agreement
- Classes
- Enumerations
- wodSFTPdll
- Create function
- Destroy function
- Methods
- Abort
- About
- AppendData
- AppendDataLen
- AppendFile
- Connect
- DeleteFile
- DeleteFiles
- Disconnect
- ExtendedCmd
- GetAttributes
- GetData
- GetDataAt
- GetDataToBuffer
- GetDataToBufferAt
- GetFile
- GetFileAt
- GetFiles
- ListAttributes
- ListDir
- ListNames
- LoadPrivateKey
- LoopFiles
- MakeDir
- PutData
- PutDataAt
- PutDataLen
- PutDataLenAt
- PutFile
- PutFileAt
- PutFiles
- RealPath
- RemoteClose
- RemoteOpen
- RemoteRead
- RemoteWrite
- RemoveDir
- Rename
- SetAttributes
- Properties
- Authentication
- Blocking
- BufferSize
- ClientName
- Compression
- Encryption
- EncryptionList
- ErrorText
- Extensions
- FIPS
- HMacList
- Hostname
- KeyExchangeList
- KeySignatureList
- LastError
- ListItem
- LocalPath
- Login
- MaxTransferRate
- MyHostname
- MyIP
- Password
- Port
- PrivateKey
- ProxyHostname
- ProxyLogin
- ProxyPassword
- ProxyPort
- ProxyType
- RemoteIdentification
- RemotePath
- Resume
- ServerErrorCode
- ServerErrorText
- State
- StateText
- Timeout
- Timezone
- TransferMode
- TransferRate
- TransferTime
- UseIPv6
- Version
- Callbacks
- How to get support
- Using callbacks
- Technical information
- Error list
AttributesData callback
Called when wodSFTP retrieves directory attributes.
Syntax
- C
void (*AttibutesData)(void *Sftp, int Count, WIN32_FIND_DATA **Items);
The AttributesData(void *Sftp,int Count,WIN32_FIND_DATA **Items) syntax has these parts:
The AttributesData(void *Sftp,int Count,WIN32_FIND_DATA **Items) syntax has these parts:
void *Sftp | Handle of the created Sftp instance. |
int Count | Total number of WIN32_FIND_DATA structures. |
WIN32_FIND_DATA **Items | Array of WIN32_FIND_DATA structures containing items information. |
Remarks
The AttributesData callback will be called as a result of ListAttributes methods. It's purpose is to provide information about directory structure in a way that is easy for your application to parse. Instead of using ListDir, which returns line-by-line directory contents that depend on the server, you can use the ListAttributes method to retrieve a collection of objects - each of them containing one directory item. For example, you can easily get information about specific item, like this:void SftpAttributesData(void *Sftp, int Count, WIN32_FIND_DATA **Items)
{
char *it = (char *)Items;
for (int i=0;i
WIN32_FIND_DATA *dt = (WIN32_FIND_DATA *)it;
SYSTEMTIME st;
FileTimeToSystemTime(&dt->ftLastWriteTime, &st);
......
it += sizeof(WIN32_FIND_DATA);
}
return;
}
This event can fire more than once when a directory contains many items. When the complete directory listing is finished, the Done event will fire. WIN32_FIND_DATA structure contains dwFileAttributes member which holds item type. It will be set to 0 if remote file is a regular file. When remote item is a directory, it will be set to FILE_ATTRIBUTE_DIRECTORY. If remote item is a symbolic link, it will be set to FILE_ATTRIBUTE_SYMLINK (defined in SftpDLL.h header file, has same value as unused FILE_ATTRIBUTE_REPARSE_POINT). NOTE: this callback is called only if you have created an instance of the SftpEventsStruct structure, and set its AttributesData member to the function implementing it.