Rename a file : File Rename « File « C / ANSI-C






Rename a file

#include <stdio.h>

int main(void)
{
  if(rename("my.txt", "your.txt")) 
    printf("Rename failed.\n");
  else
    printf("Rename successful.\n");

  return 0;
}


           
       








Related examples in the same category

1. Rename a file or directory: how to use rename