I have a weird observation.
I have a huge text file (it is like 450 MB of text)
I read the number of lines in it.. by something like this.
for i,line in enumerate(f):
count += 1
print count
In each run, I am getting a different result?
It is not like its very different.
Just that everytime I run it… it is closest to the last one.
For example if on first example it showed 8151, in the next run it shows 8162 and in next run it should 8197??
Any clues??
Is there something I am overlooking.
You likely have another process with an open write handle to the file that is writing to it. You can check what other processes have open file handles to that file with
lsof.