Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Tk - following a log file (tail -f)

by spurperl (Priest)
on Dec 03, 2003 at 13:48 UTC ( [id://311896]=perlquestion: print w/replies, xml ) Need Help??

spurperl has asked for the wisdom of the Perl Monks concerning the following question:

Fellow monks,

I have a data crunching application, that is managed through a Tk GUI. One particular function may take a long time to run, and during this time it prints useful information into a log file.

I wonder, is there a simple way (using standard Tk supplied with Active Perl 5.8 on Win 2K) to show the user this file in a "tail -f" fashion ?

Thanks in advance

Update - I'm aware of 311896, it just seems that no valuable conclusion was reached there

Replies are listed 'Best First'.
Re: Tk - following a log file (tail -f)
by sunadmn (Curate) on Dec 03, 2003 at 14:20 UTC
    Well I am not a windows user, but on my sun boxes when I have wanted to do this same thing I have just opened the file and used a pipe to read from it. I am not sure if this will help, but I figured it might give you an idea of where to start looking.

    SUNADMN
    USE PERL
Re: Tk - following a log file (tail -f)
by rinceWind (Monsignor) on Dec 04, 2003 at 10:43 UTC
    Perhaps you need to look at thread Tk tail -f - How?. I did post some code that I use for tailing inside a Tk app. Although my app runs on Unix, the code or something similar should work on any O/S that supports -s seek and tell.

    --
    I'm Not Just Another Perl Hacker
Re: Tk - following a log file (tail -f)
by Anonymous Monk on Dec 03, 2003 at 14:39 UTC
    Update - I'm aware of 311896, it just seems that no valuable conclusion was reached there
    That's your node, the one i'm replying to!!
      Woah... a self-referencing link.

      Seriously though, have you seen this reply (tye)Re8: 'Tailing' a File? to this node 'Tailing' a File?? It appears the Win32 module has a package that behaves very closely to tail. From there, I would think it would be trivial to dump it into a textbox or some other such Tk thing.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://311896]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (5)
As of 2024-03-28 16:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found