I am trying to assign the value of fileOrDir to the value of
copyFileOrDir.
You don't assign the value of a variable to the value of another variable. That's wrong to say. You assign a value to a variable. Think of a variable as a memory location. Also don't cast the result of malloc. That's not useful and can lead to bugs. Now let's come to your code snippet.
// don't cast the result of malloc
char *fileOrDir = malloc(25 * sizeof(char));
char *copyFileOrDir = malloc(25 * sizeof(char));
The following statement
copyFileOrDir = *fileOrDir;
tries to assign the object pointed to by fileOrDir, which is of type char, to copyFileOrDir, which is of type char * - a different type. This is an error. Also, by assigning copyFileOrDir, you lose the handle on the memory allocated by malloc causing memory leak. If you want to copy the buffer pointed to by fileOrDir to the buffer pointed to by copyFileOrDir, you should use memcpy.
memcpy(copyFileOrDir, fileOrDir, 25);