Merge of showtoken into sm?

Julien ÉLIE julien at trigofacile.com
Tue Nov 17 18:35:57 UTC 2009


Hi Russ,

>>> Yeah, I've been wanting to do that for quite a while, but never had the
>>> time to work on it.
>>>
>>> I suspect you'll need a new function in the storage API so that it can ask
>>> each storage backend to take apart its own tokens and return the result.
>
>> All right.
>
>> Which means that we should keep a stand-alone program "showtoken" (but
>> rewritten in C -- it seems easier than using XS) instead of integrating
>> its function to "sm"?
>
> No, I think integrating it into sm is a great idea.  I'm just saying that
> currently showtoken embeds knowledge of each of the storage backends, and
> it would be cleaner if that knowledge were instead in each storage backend
> and sm just analyzed the generic parts of the token and passed along the
> rest through a standard API to the relevant back end.  That way, if
> someone implemented a new storage backend, they'd just have to implement
> that API and sm displaying the token would immediately work for it.


Just done.
I have put for all the storage methods (except trash) the file where
the article is supposed to be stored.

It is true that the "showtoken" feature can be very useful!
Now, "sm -c" (clear information) can be used.

% sm -c '@000000000000000000000000000000000000@' '@02014B02EB7E04AA00000000000000000000@' \
'@030A41555452453100000029FBF400000001@' '@0402004B02EB000200000000000000000000@' \
'@05000000000200037AD70000000000000000@'
@000000000000000000000000000000000000@ method=trash
@02014B02EB7E04AA00000000000000000000@ method=timehash class=1 time=1258482558 seqnum=1194 
file=/home/news/spool/articles/time-01/02/eb/04aa-4b7e
@030A41555452453100000029FBF400000001@ method=cnfs class=10 buffer=AUTRE1 block=2751476 blocksize=512 cycnum=1 
file=/home/news/spool/cycbuffs/autrecnfs
@0402004B02EB000200000000000000000000@ method=timecaf class=2 time=1258482432 seqnum=2 
file=/home/news/spool/articles/timecaf-02/02/4beb.CF
@05000000000200037AD70000000000000000@ method=tradspool class=0 ngnum=2 artnum=228055 
file=/home/news/spool/articles/control/cancel/228055

-- 
Julien ÉLIE

« Videt non te diu. » 




More information about the inn-workers mailing list