Jim Wilcoxson wrote:
>
> I am kind of an efficiency freak myself. But on a Linux box, if you
> open, write, read, close, delete /tmp files in a loop, I don't think
> you see any physical disk I/O other than a 1 block directory update
> every minute or so.
>
> I totally agree that the C function is more elegant, but I've also
> learned that elegance can by highly overrated. If it's very important
> that this particular micro thing be blazingly efficient, then do it
> the right way. But if you have to invent more code to get a very
> insignificant performance boost (in the grand scheme of things), then
> it may not be worthwhile. Most of the cost is not in the initial
> development of it, but rather in the maintenance and future
> consideration of it when making other changes. If you are increasing
> the size of the code base without making a very significant
> contribution, then it's probably not worthwhile, IMO.
normally i'd agree, but this is an unusual case as the C funtion
is actually more bulletproof (in my opinion) than the tcl tempfile
solution.
the previously posted solution had more than one bug in it.
the C one i got 'right' on the second try, it being something
like 10 lines.