#include <stdio.h>
long ftell(FILE *fp)
{
fpos_t pos;
if(fgetpos(fp, &pos))
return -1;
return (long)pos;
}