cancel
Showing results for 
Search instead for 
Did you mean: 

File Poller : checking file and deciding which way to go

aspanda
New Contributor II

I am trying to use file Poller to extract the path of the file then i am using a router to check the path variable that ensures the availability of file. So i am putting two checks : one check (‘path’ in $) -(ensures file availability). second one is like !(‘path’ in $) (file not available). Second one does not work when there is no file in the directory. Is there any other snap that can be used instead of file poller to achieve this usecase?

2 REPLIES 2

tstack
Former Employee

I think the FilePoller is intended for cases where a file is expected to be created in a directory and then an action performed on that file when it appears. Are you wanting the FilePoller to produce a document when the poll is done and the file is not there? I don’t think that is supported at the moment. You could use a Script snap that periodically produces a document and then use a regular FileReader to check if the file is there. If the file is missing, the FileReader will write to the error view.

vishal_shah
New Contributor

Try using the Directory Browser Snap which will give you the Path and Name of the file which you can Map it in the Mapper and then use the Router to check for an existence of a file.