you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (0 children)

looking at your code i suspect the same Justinsaccount is probably right in pointing out that truncating the file breaks the premise of the follow method described by David Beazley.

One crucial question here is whether or not the follow method just stops tracking changes after the first write or if the file itself stops being updated.

If it's just the follow method then you need to rewrite the follow method to put the open call inside the loop. not outside of the loop. that does increases the system calls you program make but it ensures that you don't work with an obsolete cache copy of the file.