RE: tail a file (win)
Behalf Of david brochu jr
I wrote a script to monitor ping activity and output it to a
log file. I am using windows and want to have another script
constantly check the latest entry to see if Request timed out
is seen. Is there a way to "tail" a file much like I would in
Unix so I can just see the latest entry and move from there?
The method I would use that is not RAM/CPU intensive would be to create a
memory-mapped file, take the size of the file, and increment your pointer to
file_length - tail_size.
The Windows API functions to look at are:
CreateFile
CreateFileMapping
MapViewOfFile
I'm sorry, but I'm not a ctypes guru so can't tell you how you would
accomplish this in python. (The C(++) code is fairly straightforward,
however).
---
Regards,
Ryan Ginstrom
.
Relevant Pages
- Re: unix shell script ignores exit when in function that is piped to tee
... > I thought calling a function within a script did NOT create sub-shells. ... is going to be able to alter the log file to cover up any inappropriate ... entry in the log to the previous entry. ... The easiest way to use crypt to ... (comp.unix.shell) - Re: Windows Explorer size reverting to 800x600
... Microsoft MVP [Windows XP Shell/User] ... I've pre-empted your reply and looking at your script I realise that the ... A similar entry exists in ... All of the folders are on a local drive. ... (microsoft.public.windowsxp.general) - Re: Remove Toolbar from Menu
... Windows XP Shell/User ... AumHa VSOP: http://www.aumha.org ... Ok, here's the log File ... It appears the program is removed but the entry just remains. ... (microsoft.public.windowsxp.general) - Re: cron job with pid: xxxx Failed
... Do the script write a log or are there outputs sent to /dev/null. ... If the answer is /dev/null change the entry to redirect the output to a file ... > the cron yesterday & came across this entry in the cron log file under ... > There is no other explanation in the log file as to why it failed. ... (comp.unix.admin) - Re: cron job with pid: xxxx Failed
... Do the script write a log or are there outputs sent to /dev/null. ... If the answer is /dev/null change the entry to redirect the output to a file ... > the cron yesterday & came across this entry in the cron log file under ... > There is no other explanation in the log file as to why it failed. ... (comp.unix.aix) |
|