|
Change file extention on SD May 24, 2009 11:16AM | Registered: 17 years ago Posts: 191 |
|
Re: Change file extention on SD May 24, 2009 11:45AM | Registered: 17 years ago Posts: 47 |
// purpose: rename myfile.txt to myfile.tx_
#include stdio.h // Angle brackets dont work with code tags, unless there's some escape character I don't know about
int main(int argc, char *argv[])
{
if(!rename("myfile.txt", "myfile.tx_")) // rename returns -1 on error EDIT: forgot a "
{
printf("file operation did not complete successfully\n");
return 1;
}
printf("file operation completed successfully\n");
return 1;
}
curdir = argv[0]; // do this in the scope of your main() function, or pass a pointer to your arguments to another function
for(i = strlen(curdir); i >= 0; i--)
{
if (curdir == '/')
{
curdir[i+1] = '\0';
break;
}
}
chdir(curdir);
// the above will change your current working directory to the directory your "boot.dol" is in...
|
Re: Change file extention on SD May 28, 2009 11:37PM | Registered: 17 years ago Posts: 152 |
import <stdio.h>becomes
import <stdio.h>