So it loads up a list of files, but what can I do with it/how do I use it? Was hoping there is some type of iterator to go through the SFTP list and can not find one. I basically want to audit a remote Outbox that has files in it, I want to log a count of files before I Xfer them over and then I can audit them when they are received(this part I can do easily with fileset/filesetIterator), but can’t seem to find anything that can read the contents of the SFTP File List. I see it can ouput to a variable, but not really sure how that is intended to be used.
Hi Greg,
Your on the right track. Outputting the list to a variable will then enable you to iterate through the files. How they appear in the list depends on the ftp server implementation. For example they could be relative, or full path.
To get the size of the list you will need to iterate the list making sure to only count files. Again this can depend on the ftp server implementation, as some servers return . and … directories in the query we are making to the server.
Let me know how that goes.
On a side note, we are looking at updating all FTP actions in the future. Make them use the fileset object so that iteration, and getting counts is easier. If you have any other requests please feel free to write a post in the suggestions section of the FinalBuilder forums.
TY will look into that. I am mainly interested in the names and counts, not too concerned if the name or a URL, just need to be able to log what was or wasn’t “there”, and then make sure I can account for the same things making their way across the transmission into an in box. What is the recommended method for iterating throughthe variable? If I understand it, the whole list becomes a variable? So the variable is basically ofType List<> or something like that? Have not done this before so just looking for the actual action that iterates a variable.
The iterate list action is your friend here. The list will come out as CR LF separated and will be all in one variable. Use the list iterator action and set the separator as CR LF. This will give you a line for each iteration. Each line being a single file or folder which was provided by the SFTP File List action.