The Crystal programming language | http://crystal-lang.org | Fund Crystal's development: http://is.gd/X7PRtI | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/
puts "Spawning watcher.."
args = ["-q", "-r", "-m", "-e moved_to", "-e create", "-e delete", "-e modify", "--timeout #{watcher_timeout}", "-o #{watch_log_path}", "#{watch_path}"]
inotify = Process.new("inotifywait",args: ["-q", "-r", "-m", "-e moved_to", "-e create", "-e delete", "-e modify", "--timeout #{watcher_timeout}", "-o #{watch_log_path}", "#{watch_path}"])
puts "Inotify is running on PID: #{inotify.pid}"
sleep watcher_timeout
watcher_status = false
if inotify.exists?
puts "Killing inotify with PID:#{inotify.pid}"
Process.kill(Signal::KILL,inotify.pid)
end
"-e create"
Process.new("inotifywait", args: args, output: :inherit, error: :inherit)
IO::Memory
or something
src/
, just like you want to.