Reading from a file works in select()