We have an application that needs to process incoming files that are dropped into a directory. I am looking for the best way to do this.
We have been using a loopin
There's also the tiny filewatcher rubygem. The gem has no dependencies, contains no platform specific code and simply detects updates, delitions and additions by polling.
require 'filewatcher'
FileWatcher.new(["directory"]).watch() do |filename, event|
if(event == :changed)
puts "File updated: " + filename
end
if(event == :delete)
puts "File deleted: " + filename
end
if(event == :new)
puts "Added file: " + filename
end
end