[AJUDA] Renomear arquivo
#1

Tipo , tava criando um comando de alterar o nick do player, mais nгo sei qual a funзгo que renomeia o arquivo .ini para o novo nome do player :/
Alguem sabe qual a funзгo em dini que faz isso?
Reply
#2

Qual cache de salvamento vc ta usando
Reply
#3

Quote:
Originally Posted by dMagnus
Посмотреть сообщение
Qual cache de salvamento vc ta usando
Dini
Reply
#4

pawn Код:
frename(oldfile [], newfile []) // by [S]trong
{
    if (!fexist(oldfile))
    {
        return print("Error: Could file not found!");
    }

    new String [256],
        File: oldarchive = fopen(oldfile, io_read),
        File: newarchive = fopen(newfile, io_write);

    while (fread(oldarchive, String))
    {
        fwrite(newarchive, String);
    }
   
    fclose(newarchive);
    fclose(oldarchive);

    return fremove(oldfile);
}
Reply
#5

Quote:
Originally Posted by [S]trong
Посмотреть сообщение
pawn Код:
frename(oldfile [], newfile []) // by [S]trong
{
    if (!fexist(oldfile))
    {
        return print("Error: Could file not found!");
    }

    new String [256],
        File: oldarchive = fopen(oldfile, io_read),
        File: newarchive = fopen(newfile, io_write);

    while (fread(oldarchive, String))
    {
        fwrite(newarchive, String);
    }
   
    fclose(newarchive);
    fclose(oldarchive);

    return fremove(oldfile);
}
Ai eu uso assim?:

pawn Код:
frename(diretorio,tmp); //exemplo..
Reply
#6

Como eu nгo faзo a menor idйia do que as vбriaveis "diretorio" e "tmp" estгo armazenando vou postar da forma mais pura possнvel:
pawn Код:
frename(arquivoantigo, novoarquivo);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)