Take a text file from your system:
file = OpenRead["path/to/your/file"] ReadLine[file] Close[file]
ReadLine[file] should return the first line from the file. Now reopen the closed stream and read a line again:
file = OpenRead["path/to/your/file"] ReadLine[file]
I'd expect to get the first line again. However, in my system this returns the second line of the file. That is, closing a file and reopening it doesn't reset the read position.
Is this supposed to happen? From my usage of other languages such as C++ I'd expect that closing and reopening a file should reset the reading position to the beginning of the file.
Edit: I am using Mathematica 10.0.2, Ubuntu 14.04.1.
Edit 30/1/20159: This is clearly unwanted behavior. I have added the tag bug. I have not been able to contact Wolfram support because their webpage freezes for me for some reason, so please some else make the bug report.