Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- stock FileCopy(filename[60], newname[60]){
- if(!fexist(filename) || fexist(newname)){
- return false;
- }
- static
- File: Arquivo,
- Linhas[128],
- Split[256]
- ;
- Linhas[0] = '\0';
- Split[0] = '\0';
- Arquivo = fopen(filename, io_read);
- while(fread(Arquivo, Linhas)){
- strcat(Split, Linhas);
- }
- fclose(Arquivo);
- Arquivo = fopen(newname, io_write);
- fwrite(Arquivo, Split);
- fclose(Arquivo);
- return 1;
- }
- stock FileRename(filename[], newname[]){
- if(!fexist(filename) || fexist(newname)){
- return false;
- }
- static
- File: Arquivo,
- Linhas[128],
- Split[256]
- ;
- Linhas[0] = '\0';
- Split[0] = '\0';
- Arquivo = fopen(filename, io_read);
- while(fread(Arquivo, Linhas)){
- strcat(Split, Linhas);
- }
- fclose(Arquivo);
- fremove(filename);
- Arquivo = fopen(newname, io_write);
- fwrite(Arquivo, Split);
- fclose(Arquivo);
- return true;
- }
- stock FileLineCount(filename[60])
- {
- static
- File: Arquivo,
- string[128],
- Linhas
- ;
- string[0] = '\0';
- Linhas = 0;
- Arquivo = fopen(filename, io_read);
- while(fread(Arquivo, string)){
- Linhas ++;
- }
- return Linhas;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement