I'm having a problem with fgetpos and fsetpos when i call fsetpos twice.

Code:
while(0 != fgets(buffer,100,input) && strtod(buffer,NULL) < LOWER)
	fgetpos(input,&start);
	
fsetpos(input,&start);
	
while(0 != fgets(buffer,100,input) && strtod(buffer,NULL) <= upper)
	lines_needed++;
	
rewind(input);
fsetpos(input,&start_copy);
the code above works correctly, however when the rewind(input); line is removed, the second fsetpos fails to do anything at all.

At first i thoght that maybe fsetpos can only work forwards in the file, but the first fsetpos in fact works backwards, so the function must work both ways

Any ideas as to why this is happening?