24.06.2011, 10:47
I've got a problem:
The program doesn't want to create a new file. the part of the colde looks like:
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):
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"
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 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;
}
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"