#include <stdio.h>
int main () {
int ret;
char oldname[] = "file.txt";
char newname[] = "newfile.txt";
ret = rename(oldname, newname);
if(ret == 0) {
printf("File renamed successfully");
} else {
printf("Error: unable to rename the file");
}
return(0);
}
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/265295.html