ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Trigger Event on IFS directory possible?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Trigger Event on IFS directory possible?

    Hey gang! First time poster, although been lurking for a few.

    I have a directory on the IFS, lets call it '/my directory' that has multiple files dumped to it throughout the day.

    What we want is a real-time process that when a file gets written to the directory, it is immediately read, processes, then deleted by RPG program (IFS read, process, IFS delete). However, in the initial stages of designing this, im stumped at square one because im not sure there is a way to apply some type of trigger to the IFS directory informing us/a process that a new file has just been written. The way we are thinking right now is more batch - running a process every 30 minutes to copy the directory contents to a database file, then read and process each file (if any) in that database file, then deleting it from the IFS after it is processed. However, this is not 'real-time' and since it would have to run every 30 seconds or so to make it as close to real-time as possible, it would result in MUCH wasted processing (would run many times throughout the day even if nothing is in the directory).

    Also, the file names dumped will always be different, so we cannot trigger on a specific file in the IFS.

    Thanks much in advance for any possible solution!
Working...
X