Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > tailing a log file using c ...

Reply
Thread Tools

tailing a log file using c ...

 
 
CBFalconer
Guest
Posts: n/a
 
      11-21-2003
Tony Stock wrote:
>
> Thanks for the responses - food for thought.
>
> It will be on a unix platform (unknown at present though)
>
> Just a little confused, one poster said that it needs to be UNBUFFERED
> io (i.e. open / read / close), but the sample code posted uses a
> normal fileopen (fopen) ????


This is OT on c.l.c. but FYI here is an extract from the info file
for GNU tail:

> `-f'
> `--follow[=HOW]'
> Loop forever trying to read more characters at the end of the file,
> presumably because the file is growing. This option is ignored
> when reading from a pipe. If more than one file is given, `tail'
> prints a header whenever it gets output from a different file, to
> indicate which file that output is from.
>
> There are two ways to specify how you'd like to track files with
> this option, but that difference is noticeable only when a
> followed file is removed or renamed. If you'd like to continue to
> track the end of a growing file even after it has been unlinked,
> use `--follow=descriptor'. This is the default behavior, but it
> is not useful if you're tracking a log file that may be rotated
> (removed or renamed, then reopened). In that case, use
> `--follow=name' to track the named file by reopening it
> periodically to see if it has been removed and recreated by some
> other program.


--
Chuck F () ()
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net> USE worldnet address!


 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Tailing a log file? Kenji Noguchi Python 2 06-22-2007 08:33 PM
Tailing a log file? Evan Klitzke Python 0 06-22-2007 06:20 PM
How to log independently of other webapps using log4j? Also, reading from log file from within servlet? unomystEz Java 0 11-19-2006 10:42 AM
Removing the leading and tailing blanks jalkadir C++ 6 10-15-2005 03:34 AM
win32: 'Tailing' the NT event log using pipes? lebo Python 0 09-18-2003 12:14 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57