SA-MP Forums

Go Back   SA-MP Forums > SA-MP > Bug Reports

Reply
 
Thread Tools Display Modes
Old 19/11/2016, 03:03 AM   #1
Swedky
Banned
 
Join Date: Jun 2013
Location: Argentina.
Posts: 2,110
Reputation: 827
Default "fseek" doesn't work properly!

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:

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.
Swedky is offline   Reply With Quote
Old 20/11/2016, 12:03 AM   #2
SickAttack
Godfather
 
Join Date: Dec 2013
Posts: 5,254
Reputation: 751
Default Re: "fseek" doesn't work properly!

http://forum.sa-mp.com/showthread.php?t=364406

The code on the wiki doesn't even work.
SickAttack is offline   Reply With Quote
Old 20/11/2016, 03:07 AM   #3
Swedky
Banned
 
Join Date: Jun 2013
Location: Argentina.
Posts: 2,110
Reputation: 827
Default Respuesta: "fseek" doesn't work properly!

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
Swedky is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SendClientMessage "text\ntext" doesn't work [Bios]Marcel Scripting Help 2 16/05/2016 03:46 PM
Help, "Q" Doesn't work while running! Arastair Everything and Nothing 8 27/07/2015 02:30 PM
Fraction-Car "locking" doesn't work 'Pawno. Scripting Help 6 20/02/2014 05:01 PM
Why doesn't "SendDeathMessage(playerid,INVALID_PLAYER_ID,200);" work on some.. _Vortex Help Archive 7 11/10/2010 12:58 PM
Players doesn't die "properly" Luka P. Server Support 9 10/10/2010 07:25 PM


All times are GMT. The time now is 12:50 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.