Uses fseek(), ftell() and rewind().