#include <stdio.h>

#include <proto/dos.h>

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

