Created
May 15, 2009 14:57
-
-
Save flazz/112243 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
LOG_DIR = "/var/log/daitss/ingest" || ENV['DAITSS_INGEST_LOG_DIR'] | |
Dir.chdir LOG_DIR do | |
last_file = `ls -tr #{LOG_DIR} | tail -n 1`.chomp | |
open last_file do |io_potential| | |
loop do | |
a = select [io_potential], nil, nil, 1.5 | |
if a | |
io = a[0][0] | |
print io.read | |
else | |
puts 'nothing to read' # i never get here | |
break | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment