I want to check to see if a file is present before running
Post any question you may have in regards to GoAnywhere Director and let our talented support staff and other users assist you.
3 posts
Page 1 of 1
I have a project that needs to pull two files from two different remote FTP servers. The files are decrypted and then merged. After that RPG programs run to process the merged file.
I need to check each of the servers and make certain the files are both there [before] pulling either one. If I pull one and not the other the RPG jobs will fail. Once I pull either file, the remote server sees it as pulled and the file is removed from the directory where I can get to it. So I want to be able to "check for the file" but not pull either one until both files are there.
How do I do that?
- Roc
I need to check each of the servers and make certain the files are both there [before] pulling either one. If I pull one and not the other the RPG jobs will fail. Once I pull either file, the remote server sees it as pulled and the file is removed from the directory where I can get to it. So I want to be able to "check for the file" but not pull either one until both files are there.
How do I do that?
- Roc
- Support Specialist
- Posts: 91
- Joined: Thu Mar 05, 2009 3:49 pm
- Location: Ashland, NE USA
-
Use the Create File List task. In that task, capture the number of files found.
Do this for each server. If the count is greater than zero, then proceed with your project.
The Create File List Task will create a File List Variable based on the filters specified in the File Set. This variable will contain the file paths of the files found. That variable can then be used in other tasks by specifying that name in the Input Files Variable attribute. The Number of Files Found Variable will contain a count of the files, which is useful in other tasks by using the Execute Only If condition and checking to see if the number of files found is greater than zero.
Do this for each server. If the count is greater than zero, then proceed with your project.
The Create File List Task will create a File List Variable based on the filters specified in the File Set. This variable will contain the file paths of the files found. That variable can then be used in other tasks by specifying that name in the Input Files Variable attribute. The Number of Files Found Variable will contain a count of the files, which is useful in other tasks by using the Execute Only If condition and checking to see if the number of files found is greater than zero.
3 posts
Page 1 of 1