From: Robert Klemme Date: 2009-07-07T05:00:05+09:00 Subject: Re: file.seek and unused bytes On 06.07.2009 21:47, Greg Willits wrote: >> What about storing all file offsets >> in an Array and write it to a file > > That's a possibility that would be an easy retrofit and probably w/o > breaking the current interfaces. It would use a little more RAM, but > would eliminate calculating that offset each time during reads. That's > not a real pinch point, but worth an experiment just because it's a > simpler concept to recognize. I'd be interested to learn the outcome of that exercise. >> Did you consider to make your dsl generate the code >> or is that what you are doing? > > If I interpret the question correctly, that's what we're doing. I may be > using "DSL" a little loosely here though. It's more like an "active > config" language. I write setup files that are a mixture of k-v pairs > for certain things, and expressions for other things. All of that gets > processed at the start of every aggregation run which results in a > number of Ruby Module files being created which get included > dynamically. Only that you do not need to write this into files but you can do that in memory with eval. Anyway, that's just a detail. :-) > Many thanks for all the thoughts & feedback. You're welcome! Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/