"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
#2

https://sampforum.blast.hk/showthread.php?tid=364406

The code on the wiki doesn't even work.
Reply
#3

So I think that function works (seek in the file), but doesn't return what it should return.

I'll try to do it manually
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)