in reply to Reading from where I left off

I did this but that ISP went out of business /very/ suddenly so I doubt I have the code now.

I stored the inode of the file along with the seek position as the log I was incrementally parsing would be rolled once each month (you may also want to start from the front of the file if your saved seek position is beyond the end of the file).

One trick was that you likely need to handle the last line not containing a newline, which means you shouldn't process it yet. I did tell before each 'readline' and retuned if no newline got read, leaving me with the start of that line as the last place I telled.

- tye        

  • Comment on Re: Reading from where I left off (tmi)