fopen returns NULL
#1

I've got a problem:

The program doesn't want to create a new file. the part of the colde looks like:
pawn Код:
if(!fexist(SettingFile))
{
    dini_Create(SettingFile);
    dini_IntSet(SettingFile, "PocketMoney", 1000);
    dini_IntSet(SettingFile, "AnnounceSeconds", 3);
    dini_IntSet(SettingFile, "PassMin", 3);
    dini_IntSet(SettingFile, "PassMax", 15);
}
I am sure that file doesn't exist.
I have tried to figure out the problem and I realised the problem comes here(in dini_Create):
pawn Код:
stock dini_Create(filename[]) {
    if (fexist(filename))
    {
        return false;
    }
    new File:fhnd;
    fhnd=fopen(filename,io_write);
    if (fhnd) // IT DOESN'T ENTER THIS if clause <-----
    {
        fclose(fhnd);
        return true;
    }
    return false;
}
So fopen returns NULL.
I don't know how to fix that.
Btw. I have reinstalled my computer and now it doesn't work(but before it worked perfectly)
I have aloso some dini_Create which work perfectly.
I would be very greatful if you can help me.

PS: Sorry for that codes, I dunno how to put "pawn code console"
Reply


Messages In This Thread
fopen returns NULL - by Roko_foko - 24.06.2011, 10:47
Re: fopen returns NULL - by Wesley221 - 24.06.2011, 10:48
Re: fopen returns NULL - by Roko_foko - 24.06.2011, 10:49
Re: fopen returns NULL - by Wesley221 - 24.06.2011, 10:54
Re: fopen returns NULL - by Roko_foko - 24.06.2011, 10:57
Re: fopen returns NULL - by Roko_foko - 24.06.2011, 11:07

Forum Jump:


Users browsing this thread: 1 Guest(s)