#137624 - calcprogrammer1 - Tue Aug 14, 2007 4:01 am
How do you rename using libfat? I thought it was:
rename(char* oldname, char* newname);
but this is my code:
Problem is, this code does nothing on Desmume (once you hit Enter it doesn't rename, but it still runs), and crashes on real DS (and when rebooted, it's not renamed).
_________________
DS Firmware 1, Datel Games n' Music card / Chism's FW hacked GBA MP v2 CF
There's no place like 127.0.0.1.
rename(char* oldname, char* newname);
but this is my code:
Code: |
void renameFile(char *file){
char * oldfile = file; PA_16cText(0,0,17,255,33,"Rename File:",1,1,100); PA_16cText(0,0,34,255,50,file,1,1,100); s32 nletter = strlen(file); char letter = 0; while(letter != '\n'){ letter = PA_CheckKeyboard(); if(letter > 31){ file[nletter] = letter; //clear screen, update text }else if((letter == PA_BACKSPACE)&&nletter){ nletter--; file[nletter] = ' '; //clear screen, update text } PA_WaitForVBL(); } PA_ClearBg(0,2); rename(oldfile,file); } |
Problem is, this code does nothing on Desmume (once you hit Enter it doesn't rename, but it still runs), and crashes on real DS (and when rebooted, it's not renamed).
_________________
DS Firmware 1, Datel Games n' Music card / Chism's FW hacked GBA MP v2 CF
There's no place like 127.0.0.1.