#include <stdio.h>

long ftell(FILE *f)
{
    long offset;
    offset=Seek(f->filehandle,0L,0L);
    if(f->flags&_READ) offset-=f->count;
    if(f->flags&_WRITE) offset+=f->bufsize-f->count;
    return(offset);
}

