I have tried really hard but could not figure out a way to print an error if
find -name \"filename"
does not find any file. The code I am using so far is as follows:
char *argv[];
argv[0]="find";
argv[1]="-name";
argv[2]=strcat(str,"\abc.txt");
argv[3]=NULL;
pid_t pid;
pid= fork();
if(pid==0)
{
execvp(argv[0],argv);
printf("file does not exist");
}
But I can't print my print statement because find -name \"filename"
never returns an error.