Here’s the initial implementation of the tail command if anyone wants to try it out.
https://github.com/gcopley/commandbox/tree/add_tail_command
Any and all feedback is welcomed!
Best,
Grant
Here’s the initial implementation of the tail command if anyone wants to try it out.
https://github.com/gcopley/commandbox/tree/add_tail_command
Any and all feedback is welcomed!
Best,
Grant
Added it to the core now.
I think for next version, let’s add a “interactive” argument, were the console can stay and monitor the file for changes
Luis Majano CEO Ortus Solutions, Corp www.ortussolutions.com P/F: 1-888-557-8057 Direct: (909) 248-3408 ColdBox Platform: http://www.coldbox.org ContentBox Platform: http://www.gocontentbox.org Linked In: http://www.linkedin.com/pub/3/731/483 Social: twitter.com/ortussolutions | twitter.com/coldbox | twitter.com/lmajano | twitter.com/gocontentbox
There is a bug in the tail command as the java.io.RandomAccessFile class needs to be closed or it keeps locks open on the file. Since Luis has already manually merged it, I’ll commit a fix.
Other than that, it seems to work pretty well.
Thanks!
~Brad
ColdBox Platform Evangelist
Ortus Solutions, Corp
E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com
Great observation. It might need a finally block
Luis Majano
CEO
Ortus Solutions, Corp
P/F: 1-888-557-8057
Direct: (909) 248-3408
ColdBox Platform: http://www.coldbox.org
ContentBox Platform: http://www.gocontentbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Social: twitter.com/ortussolutions | twitter.com/coldbox | twitter.com/lmajano | twitter.com/gocontentbox
Yes, that’s exactly what I did. That way it’s guaranteed to close even if something errors.
Thanks!
~Brad
ColdBox Platform Evangelist
Ortus Solutions, Corp
E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com
Good catch Brad! Thanks!