Exemple d’utilisation de la fonction ‘int rename ( const char *ancien_nom , const char *nouveau_nom )’ pour renommer un fichier

Author:


Download

  #include // Bibliothèque de la fonction 'rename'

  int main(int argc, char *argv[])
  {
	// La fonction retourne 0 en cas de succès
    if(rename("c:/test.txt", "c:/testnouveau.txt") != 0)
	{
       printf("Impossible de renommer ce fichier");
	   return -1;
    }
	printf("Le fichier à été renommé");
    return 0;
  }

Leave a Reply

Your email address will not be published. Required fields are marked *