[PATCH] coreutils tac (was: coreutils tac)
Natanael Copa
natanael.copa at gmail.com
Sat Dec 29 02:20:30 PST 2007
On Sat, 2007-12-29 at 08:29 +0100, Tito wrote:
> On Saturday 29 December 2007 03:18:13 Denys Vlasenko wrote:
> > On Friday 28 December 2007 21:36, Tito wrote:
> > > just for fun I've created an alternative version of tac
> > > using only linked lists in memory. Probably the size
> > > is smaller but I haven't checked it yet as I
> > > would like to hear first the opinion of the list
> > > members about it. For the same reason i haven't
> > > attached a patch but only a drop in replacement
> > > of tac.c.
> > > Hints, critics, improvements and correction
> > > are always welcome!!!
> >
> > Small :)
> >
> > What will happen with big files?
> > --
> > vda
> >
>
> With big files there will be an out of memory error and
> the applet is not NOFORK.
I believe tac is mostly used on small files and on pipes. In
comparation, my version is basicly extending the swap with /tmp.
> There are also some bugs with embedded '\0' chars
> and lines ending without '\n'
> that i think i've fixed in this version.
> More tests are needed with special files
> as i tested only with regular files, empty files,
> links, broken links and directories.
> New version attached.
I think this would be good enough. I don't think anybody would like to
use tac on special files.
Denys, please let me know if you want me to fix my mmap version of tac,
otherwise I suggest we use Tito's version until someone reports problem
with out of memory. Then we can start looking at using mmap.
Thanks Tito!
> Ciao,
> TIto
>
-nc
More information about the busybox
mailing list