I'm trying to make a program that deletes a file called biblio.exe which is in the root dir. I try to accomplish that by first going to the root dir (I think I'm correct) and then opening the file and then using remove.
But it doesnt seem to work, what's wrong?? It says "error en remove".
#include "stdio.h"
#include "stdlib.h"
main(void)
{
FILE *fp;
system("cd..");
system("cd..");
system("cd..");
system("cd..");
if((fp=fopen("biblio.exe","rb"))==NULL){
printf("Error al abrir archivo!");
exit(1);
}
if(remove(fp)) printf("Error en remove!");
}