On Fri, Aug 23, 2002 at 05:30:17PM -0700, Rob Bloodgood wrote: > I'm trying to figure out what is intended by the default behavior of > "SeekBack" on P:W:FollowTail... it sez the default is to use 4096 bytes but > the description implies that if the default is used, those 4096 bytes are > just silently dropped?
Yes. The default behavior is to seek back an arbitrary number of bytes (4K) and throw them away. This is done so FollowTail doesn't return partial records by default. > Whereas if a value is specified, and is larger than the actual filesize, it > will just go back to the SEEK_SET and use that. (according to the docs) Yes. This allows FollowTail to return an entire file and then continue tailing it from its end. > Wouldn't a more reasonable behavoir be to rewind $SeekBack bytes, and scan > til the next (filter determined) record beginning, and resume from there? You assume the filter uses a record delimiter. Not all logs are like that. For example, /var/log/wtmp and /var/run/utmp use fixed-length records. No amount of scanning will properly frame them if you've seeked to a bad location. There's probably a good way to do this, but I don't tail files that much. I invite you (or anyone who's using FollowTail a lot) to offer a better interface. In the meantime, if a user is going to specify a location in the middle of the file, I'd rather it be her responsibility to ensure the location is valid. > Otherwise I'm thinking that the best way to use the parameter (in order to > NOT miss anything) is to set SeekBack to be ridiculously large, and thus > guarantee no records (lines) are lost. > > Comments? Did I miss something? No, that's probably the only way to be absolutely sure with FollowTail as it's currently written. Suggestions, patches, and entire redesigns or reimplementations are welcome. -- Rocco Caputo / [EMAIL PROTECTED] / poe.perl.org / poe.sf.net
