I do programming in the C programming language and experimented with a function rename(). I am using the following code:
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
if(rename ("data", "database") )
{
fprintf(stderr, "Can't rename file\n");
exit(EXIT_FAILURE);
}
return 0;
}
This code changes the name of the file named "data" to a file called "database". I was wondering what would happen if you tried to run this code, but already had a file called "database" in the same directory.
This is the contents of the directory that I have before running the function rename():

And this is the contents of the directory that I have after running the function rename():

, rename() , , . , rename(), , (Windows 10 - cygwin64 - gcc-). , , , , ? .