How to do this ?
#2

Check if it exist before reading it, And if not, then create it, using Fexist
pawn Код:
if(!fexist("sucks.txt"))
{
    printf("failed to open sucks.txt, creating new one..");
       
    new File:file = fopen("sucks.txt", io_write);
    if(file) fclose(file);
}
new File:fp = fopen("sucks.txt", io_read);
if (fp)
{
    new buf[128];
    fread(fp, buf);
    fclose(fp);
}
Reply


Messages In This Thread
Solved : Code / Server Stops when write - by Joe_Goro - 28.11.2013, 11:08
Re: How to do this ? - by xVIP3Rx - 28.11.2013, 11:20
Re: How to do this ? - by Konstantinos - 28.11.2013, 11:22
Re: How to do this ? - by Joe_Goro - 28.11.2013, 11:26
Re: How to do this ? - by Konstantinos - 28.11.2013, 11:29
Re: How to do this ? - by Joe_Goro - 28.11.2013, 11:37
Re: How to do this ? - by Konstantinos - 28.11.2013, 11:41
Re: How to do this ? - by Joe_Goro - 28.11.2013, 11:43
Re: How to do this ? - by Joe_Goro - 28.11.2013, 21:10

Forum Jump:


Users browsing this thread: 3 Guest(s)