Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

djberg96 (2603)

djberg96
  (email not shown publicly)

Journal of djberg96 (2603)

Monday July 29, 2002
07:54 PM

Ports and game re-ports

[ #6735 ]
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.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • 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.

    --
    J. David works really hard, has a passion for writing good software, and knows many of the world's best Perl programmers
    • 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.

      --
      J. David works really hard, has a passion for writing good software, and knows many of the world's best Perl programmers
      • 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