[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Requesting for review of the Draft proposal for - procfs
From: |
Carl Fredrik Hammar |
Subject: |
Re: Requesting for review of the Draft proposal for - procfs |
Date: |
Fri, 28 Mar 2008 11:21:42 +0100 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) |
<olafBuddenhagen@gmx.net> writes:
> I don't quite see the need for a special library here -- what would it
> provide over plain libtrivfs?...
It seems to me that many (most?) of the translators will be /very/
simple. For uptime, cpuinfo, cmdline etc. their task boils down to
gather some info and produce a string using with asprintf().
This is much like the hello translator, except with a parameterized
string. For something so simple the hello translator is still ~200
lines of code and I suspect it will get tedious and error-prone to
write several such translators when the actual functionality can be
summed up in 30 lines or so.
This won't cover all the proc translators, but I suspect there will be
a need to factor out commonalities in other cases as well. It
perhaps a mistake to view it as a /single/ library.
That said, I agree with you that it's best to start with writing some
translators and *then* refactor them. It's very easy to fall into the
``must handle every single case'' trap, as I know I have done on
occasion. :-)
Regards,
Fredrik
Re: Requesting for review of the Draft proposal for - procfs, olafBuddenhagen, 2008/03/27