file parsing/watching + qt

A

aljosa

this is a Qt app. app should watch for changes in /var/log/isdn.log and
on file change (like new line was added to isdn.log) it should activate
event in my app.

i'm trying to fetch last line in file whenever isdnlog logs something
so that i can parse that line for a number and store it somewhere else,
is there a standard solution for this?

i'm using python2.3 on linux with PyQt3.


Aljosa
 
P

Phil Thompson

this is a Qt app. app should watch for changes in /var/log/isdn.log and
on file change (like new line was added to isdn.log) it should activate
event in my app.

i'm trying to fetch last line in file whenever isdnlog logs something
so that i can parse that line for a number and store it somewhere else,
is there a standard solution for this?

i'm using python2.3 on linux with PyQt3.

This is UNIX/Linux specific, but one way would be to use QProcess to run
"tail -f /var/log/isdn.log" and connect the readyReadStdout() signal to
the Python callable that will handle the line.

Phil
 
S

Swaroop C H

i'm trying to fetch last line in file whenever isdnlog logs something
so that i can parse that line for a number and store it somewhere else,
is there a standard solution for this?
i'm using python2.3 on linux with PyQt3.

Use the Python binding to FAM (File Alteration Monitor):
http://python-fam.sourceforge.net/


HTH,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top