fremove() not working
#1

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.
Reply
#2

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.
Reply
#3

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

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...
Reply
#5

fremove is not bugged, I use it.

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

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

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.
Reply
#8

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

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)
Reply
#10

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


Forum Jump:


Users browsing this thread: 1 Guest(s)