[Include] Some Small Functions
#5

Quote:
Originally Posted by ******
Посмотреть сообщение
Do you know WHY people claim that dini isn't a very good file system? Because it's slow! Why is it slow? Because it opens, writes, and closes, the file for EVERY operation instead of buffering data for more efficient writes. You figure out why I'm telling you this.

Also, we have a shiny new "Includes" forum - I moved this one there but you might want to pay more attention in the future.
So you mean that this method is better:
pawn Код:
new File:cmdlog;

public OnGameModeInit()
{
    cmdlog = fopen("logs/commands.txt", io_append);
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    fwrite(cmdlog, cmdtext);
    fwrite(cmdlog, "\r\n");
    return 0;
}

public OnGameModeExit()
{
    fclose(cmdlog);
    return 1;
}
And this method not:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    new File:cmdlog = fopen("logs/commands.txt", io_append);
    fwrite(cmdlog, cmdtext);
    fwrite(cmdlog, "\r\n");
    fclose(cmdlog);
    return 0;
}
?
Reply


Messages In This Thread
REMOVE PLEASE - by milanosie - 28.06.2012, 21:03
Re: Some Small Functions - by milanosie - 28.06.2012, 21:16
Re: Some Small Functions - by AndreT - 29.06.2012, 21:14
Re: Some Small Functions - by ipsBruno - 29.06.2012, 22:37
Re: Some Small Functions - by BlackBank - 30.06.2012, 14:41

Forum Jump:


Users browsing this thread: 1 Guest(s)