rewind(3): reposition stream - Linux man page
FAQ > Why it's bad to use feof() to control a loop - Cprogramming.com