LinuxQuestions.org
Support LQ: Use code LQCO20 and save 20% on CrossOver Office
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
LinkBack Search this Thread
Old 06-16-2009, 01:52 AM   #1
shibeaux
LQ Newbie
 
Registered: Nov 2008
Posts: 24

Rep: Reputation: 15
Monitoring log file changes from c++ app


I'm trying to monitorize changes in a log file, but I don't figure out how to do it. I wish to do something similar to select() function used to detect changes in a socket, but I don't fin the way to do it, I mean, some c++ function that keeps idle until the selected file changes, and then returns a result showing the change that has happened.

Thanks in advance.
 
Old 06-16-2009, 03:15 AM   #2
noctilucent
Member
 
Registered: Jun 2009
Distribution: slackware
Posts: 123

Rep: Reputation: 25
Use a file alteration monitor. If your target is "Linux", check out inotify.
 
Old 06-16-2009, 03:34 AM   #3
shibeaux
LQ Newbie
 
Registered: Nov 2008
Posts: 24

Original Poster
Rep: Reputation: 15
As far as I know, FAM & inotify are both command line apps, so are not suitable in this case. I ned to do this monitorization from a c++ app, so I'm looking for a syscall (similar to select()) to detect changes in a log file.
 
Old 06-16-2009, 03:44 AM   #4
noctilucent
Member
 
Registered: Jun 2009
Distribution: slackware
Posts: 123

Rep: Reputation: 25
You don't know far enough. http://en.wikipedia.org/wiki/Inotify
 
  


Reply

Tags
logfile


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SUN One App Server - I lost a log file and I can't get up!! vous Linux - Newbie 1 06-26-2008 05:10 AM
File Monitoring App? embsupafly Linux - Software 2 12-18-2003 01:55 PM
File Monitoring App? embsupafly Linux - Software 1 12-18-2003 11:15 AM
Monitoring a Specific Port and Exporting to a log file chrisfirestar Linux - General 0 10-27-2003 04:17 AM
monitoring app in blackbox mace Linux - General 2 05-15-2002 09:36 PM


All times are GMT -5. The time now is 03:17 AM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration