SA-MP Forums Archive
fremove() not working - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: fremove() not working (/showthread.php?tid=158800)



fremove() not working - Whizion - 11.07.2010

Is this a bug or im using it wrong?

pawn Код:
cmd(delete, playerid, params[])
{
    new string[128];
    if(IsPlayerConnected(playerid) && PlayerLoggedIn[playerid])
    {
        new name[32];
        if(sscanf(params, "s",name))
        {
            SendClientMessage(playerid, COLOR_HELP, "USAGE: /delete [file]");
            return 1;
        }
        format(string, sizeof(string), "Accounts/%s.ini",name);
        fremove(string);
     }
     return 1;
}
Please help, thanks.


Re: fremove() not working - Calgon - 11.07.2010

fremove() indeed does seem to be slightly buggy, and not always removing files. Not sure why though, I used a plugin to fix this when I had a server using Linux.


Re: fremove() not working - Stepashka - 11.07.2010

fail used, use:
if(!fremove(string))fremove(string);
or
while(fremove(string)){}


Re: fremove() not working - Whizion - 11.07.2010

Quote:
Originally Posted by Stepashka
Посмотреть сообщение
fail used, use:
if(!fremove(string))fremove(string);
or
while(fremove(string)){}
Neither of those work for me.

Well then, if fremove() is realy bugged, can you give me a working frename() ?

I really need one of this two...


Re: fremove() not working - Grim_ - 11.07.2010

fremove is not bugged, I use it.

Make sure that you are logged in when attempting to use this command.


Re: fremove() not working - Whizion - 11.07.2010

I am logged in, and it doesn't work.


Re: fremove() not working - Grim_ - 11.07.2010

Are you positive you are inputting the correct file?

Try testing it out without formatting a string:
pawn Код:
cmd(text, playerid, params[])
{
   #pragma unused params
   fremove("test.txt");
   return 1;
}
And create text.txt in scriptfiles folder.


Re: fremove() not working - Whizion - 11.07.2010

Yes it works, but can you tell me then where did i go wrong with my code?


Re: fremove() not working - Grim_ - 11.07.2010

Are you sure you have an Accounts folder in scriptfiles?
Does that file exist?
Are you typing in the incorrect file name? (If you type /delete test , it'll delete Accounts/test.ini)


Re: fremove() not working - Simon - 11.07.2010

Also, Linux OS's are case sensitive I've found so keep in mind the correct case is important.