On Wed, Dec 29, 2010 at 11:03:22AM +0300, Vadim Zhukov wrote:
| On 29 December 2010 c. 04:12:34 Jeremy C. Reed wrote:
| > tail -r
| 
| tail(1) saves all data in memory. So if you want to reverse very big file
| (say, some sort of log) you'll have to construct monsters with help of
| awk/perl/etc.

It does that for non-regular files, sure (how else would you do it ?
You use a swapfile in your patch.  So you assume (probably quite
fairly, but not always valid I suppose) that there's more diskspace
available than memory but you do so at significant cost in terms of
disk access).

But see /usr/src/usr.bin/tail/reverse.c:r_reg for regular files, this
basically does what you do in print_swap.

Paul 'WEiRD' de Weerd

-- 
>++++++++[<++++++++++>-]<+++++++.>+++[<------>-]<.>+++[<+
+++++++++++>-]<.>++[<------------>-]<+.--------------.[-]
                 http://www.weirdnet.nl/                 

Reply via email to