Ports and game re-ports

djberg96 on 2002-07-30T00:54:06

I've decided to give porting Matija Grabnar's File::Tail module over to Ruby a shot. I actually already have a basic implementation working, though I had to install 1.7.2 to do it. Seems there's no sysseek in 1.6.7. I see there are quite a few configurable options in Matija's module, though I'm betting 99% of us use the defaults 100% of the time. I have to decide if I want to try to duplicate that flexibility or simply add it on a user request only basis.

In gaming news, I've been playing Disciples II a lot lately. I'd describe it as a cross between Heroes of Might and Magic and Final Fantasy. It's good, but not great. Good time killer, though, and for only $30 I'm not complaining.


File::Tail options

jdavidb on 2002-07-31T15:22:28

To be honest, I cut and paste File::Tail options out of a two year old program a co-op developed. I have little (retained) knowledge of what they do. I do know that the module doesn't work exactly the way I expect if I don't use those options, and I do seem to recall that the options that make it do what I want are not the options I would expect.

Re:File::Tail options

jdavidb on 2002-07-31T15:23:37

By the way, while you're thinking about writing your own, I have a File::Tail::Seekable subclass I created for one application. That might be a common desire in any language.

Re:File::Tail options

djberg96 on 2002-07-31T19:37:03

Thanks for the info. While looking at the source, I was befuddled by some of the things he does, but perhaps it will make more sense to me later. Perhaps it's because I settled on a line based approach to reading data over a character based one.

Here's a brief example of usage in case you're interested:

t = Tail.new("somefile.txt")

# To imitate 'tail -f', use a block
t.tail do |line|
   puts line
end

# To simply grab the last X lines, don't use a block
a = t.tail(20)
puts a