no sure if 'rewind' is a standard - use fseek instead