"fseek" doesn't work properly!
#1

So I was making some tests with "fseek" and I found that it always return "0".
I used the Wiki example in a blank script and I get the same problem...

This is my script:

pawn Code:
public OnFilterScriptInit()
{
    new File:handle = fopen("file.txt", io_read);

    if(handle)
    {
        printf("Begin of file position: %d", fseek(handle, 0, seek_start));
        printf("End of file position: %d", fseek(handle, 0, seek_end));
        printf("Currrent file position: %d", fseek(handle, 0, seek_current));
        fclose(handle);
    }
    else print("Failed to open \"file.txt\".");
    return 1;
}
My "file.txt":

Code:
H20IBJWEKLBN23098NJWKLRGJSEFR
V2IGODSJF2J40G9JRENBJOVKSDFGJW4IOFTG4W
IW43GOSDIGJ4W9GHWG8ESOKGNSLV
G3I4OGWJH4OIGJUW0EIJSGLKDVMKGL
GWGNWONDISNSGDIOGDSOI420GN023I4N4GI01GT024IGJ40O3
42GI024NVO2ING2O4NGI2
Does it works for you?
Regards.
Reply


Messages In This Thread
"fseek" doesn't work properly! - by Swedky - 19.11.2016, 03:03
Re: "fseek" doesn't work properly! - by SickAttack - 20.11.2016, 00:03
Respuesta: "fseek" doesn't work properly! - by Swedky - 20.11.2016, 03:07

Forum Jump:


Users browsing this thread: 1 Guest(s)