Back to product page
- Introduction
- Overview
- License agreement
- Getting Started
- Objects
- Enumerations
- wodSFTP
- Methods
- Abort
- About
- AppendData
- AppendFile
- Connect
- DeleteFile
- DeleteFiles
- Disconnect
- ExtendedCmd
- GetAttributes
- GetData
- GetDataAt
- GetFile
- GetFileAt
- GetFiles
- ListAttributes
- ListDir
- ListNames
- LoopFiles
- MakeDir
- PutData
- PutDataAt
- PutFile
- PutFileAt
- PutFiles
- RealPath
- RemoteClose
- RemoteOpen
- RemoteRead
- RemoteWrite
- RemoveDir
- Rename
- SetAttributes
- SetAttributes64
- Properties
- Authentication
- Blocking
- BufferSize
- ClientName
- Compression
- Encryption
- EncryptionList
- ErrorText
- Extensions
- FingerPrint
- FIPS
- HMacList
- Hostname
- KeepAlives
- KeyExchangeList
- KeySignatureList
- LastError
- ListItem
- LocalPath
- Login
- MaxTransferRate
- MyHostname
- MyIP
- Notification
- Password
- Port
- PrivateKey
- ProxyHostname
- ProxyLogin
- ProxyPassword
- ProxyPort
- ProxyType
- RemoteIdentification
- RemotePath
- Resume
- ServerErrorCode
- ServerErrorText
- State
- StateText
- Timeout
- Timezone
- TransferMode
- TransferRate
- TransferTime
- UseIPv6
- Version
- Events
- Methods
- IwodSFTPNotify
- SftpItem
- SftpItems
- How to get support?
- Technical information
- Fast notifications interface
- Error list
LoopItem method
Called before wodSFTP performs operation on item from the GetFiles/PutFiles/DeleteFiles/LoopFiles sequence.
Type
NoneSyntax
- Basic
object.LoopItem Owner, LocalFile, RemoteFile, ItemType, Skip
The LoopItem(object,Owner,LocalFile,RemoteFile,ItemType,Skip) syntax has these parts:
The LoopItem(object,Owner,LocalFile,RemoteFile,ItemType,Skip) syntax has these parts:
object | An expression evaluating to an object of type IwodSFTPNotify. |
Owner | A wodSFTPCom object. |
LocalFile | A String value. Full path to file/folder on local disk. |
RemoteFile | A String value. Full path to file/folder on remote server. |
ItemType | A DirItemTypes enumeration. Type of the item - file, folder, symbolic link. |
Skip | A Boolean value. When set to True then intended operation is not performed on the item. |
Remarks
This method is only called if you implemented the IwodSFTPNotify interface in your application and the wodSFTP.Notification property has received a reference to an instance of your implementation.This event fires as result of GetFiles, DeleteFiles, PutFiles and LoopFiles methods. It provides information about each item in the sequence (meaning file or folder) before actual operation on that item is executed - allowing you to optionally Skip the operation for this particular item. Since both LocalFile and RemoteFile arguments can be changed, you can also cause operation to be performed on completely different files than it would be in original operation.
For example, you can use LoopItem event like this:
Private Sub Sftp1_LoopItem(LocalFile As String, RemoteFile As String, ByVal ItemType As wodSFTPComLib.DirItemTypes, Skip As Boolean)
If ItemType = typeDirectory Then
Skip = False
Else
If Right$(RemoteFile, 4) = ".txt" Then
Skip = False
Else
Skip = True
End If
End If
End Sub
which means that only files ending with ".txt" are copied - others are skipped (but directories are created, just in case).
You can also use it like this: we will copy all ".txt" files to the same directory, no matter where they originate from:
Private Sub Sfp1_LoopItem(LocalFile As String, RemoteFile As String, ByVal ItemType As wodSFTPComLib.DirItemTypes, Skip As Boolean)
If Right$(RemoteFile, 4) = ".txt" Then
LocalFile = "c:\mytxtfiles\file" & Counter & ".txt"
Counter = Counter + 1
Skip = False
Else
Skip = True
End If
End Sub
above sample will not create directory structure at all - but still would copy all .txt files to differently named files on local disk.