Hi Shipra,
I had faced a similar situation sometime back, & handled it with a slightly different approach.
1. Here, I've configured the tFileList component to list the files in descending order of 'latestModifiedTime'.
This would result in the last file listed first.
2. Then, I've used a FLAG approach to process only the first file listed by tFileList component.
For this, I've used 2 tJava components, one to initiate a Flag (& then store it to global map) & on successful processing of the first file, this flag would be updated.
3. The link between the tFileList component & tFileInputDelimited component is an 'IF' condition with the FLAG. This condition allows process flow only if the FLAG is true.
4. This FLAG, which would be initialized to 'True', would be updated to 'False' on first successful execution. Thus, only the first (latest) file would get processed.
I would agree that your approach of selectively picking the latest file using the filemask would also work, but still be dependant on generating the filemask for the latest file. On the contrary, the above approach is independent of filemask condition & can be used as-is in other scenarios as well.
Let me know if your concerns persists.
MathurM