# Re: ruby tail

**URL:** <https://www.ruby-forum.com/t/re-ruby-tail/86445>\
**Category:** Ruby\
**Created:** [February 22, 2007, 10:39am UTC](https://www.ruby-forum.com/t/re-ruby-tail/86445 "2007-02-22T10:39:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Phy\_P](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a587f6/32.png) [@Phy\_P](https://www.ruby-forum.com/u/Phy_P)\
**Post date:** [February 22, 2007, 10:39am UTC](https://www.ruby-forum.com/t/re-ruby-tail/86445/1 "2007-02-22T10:39:01Z")

</div>

The issue there is that how do I detect new output and then capture that  
output as in tail -f ?

----- Original Message ----  
From: Kevin J. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
To: ruby-talk ML [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Sent: Thursday, February 22, 2007 1:33:19 AM  
Subject: Re: ruby tail

> Is there a gem or perhaps a method I am not aware of that does the similar function of tail? Or is there a way to use tail in ruby? I have a file that I want to process as new data is appended to the file. This is easy enough using tail and tail has the added advantage that it can follow a file if it is “rolled”.

Just call out to tail

def tail(f)  
`tail f`  
end

or similar - if tail does what you want, use it

Kev
