25.07.2012, 02:16
Since I updated old YSI to new one (3.1) I have issue related to deleting files.
So I have this deleteacc command which I use for deletting accounts, and it is very simple...
If I am admin (of certain level or more) + sscanf for string (because Name_Surname is string), if account of that string exist, script removes it (with fremove funcion).
Before updating the YSI it all worked fine.
But, as I tested it on my home server, I created new account... and quited the game. After that I tryed to delete account manually... I got some error saying something like 'file in use, cannot be removed etc.'
And next thing I wanted to see is the fremove funcion => https://sampwiki.blast.hk/wiki/Fremove
Where it says => Note: If the file you are attempting to delete is open at the time that fremove is used, it will not work. You must first use fclose before you try deleting it, that is, if you have used fopen.
My question would be: Is there a way to fix this or this is because of y_ini include ..
Btw: I have /changename command also 'not working' as it should. (Set new player name, create new file for name, update the player to new file, delete the old file - it doesnt want to, so it acctually creates 1 extra account)
Thanks for reading.
So I have this deleteacc command which I use for deletting accounts, and it is very simple...
If I am admin (of certain level or more) + sscanf for string (because Name_Surname is string), if account of that string exist, script removes it (with fremove funcion).
Before updating the YSI it all worked fine.
But, as I tested it on my home server, I created new account... and quited the game. After that I tryed to delete account manually... I got some error saying something like 'file in use, cannot be removed etc.'
And next thing I wanted to see is the fremove funcion => https://sampwiki.blast.hk/wiki/Fremove
Where it says => Note: If the file you are attempting to delete is open at the time that fremove is used, it will not work. You must first use fclose before you try deleting it, that is, if you have used fopen.
My question would be: Is there a way to fix this or this is because of y_ini include ..
Btw: I have /changename command also 'not working' as it should. (Set new player name, create new file for name, update the player to new file, delete the old file - it doesnt want to, so it acctually creates 1 extra account)
Thanks for reading.