Shouldn't printData move to the beginning of the file _before_ reading anything from it?

Have you checked there are multiple rows of data in the file when you call printData (e.g. by viewing it in Notepad or similar)?