In C Write a recursive function that copies one directory to another. ./copy dir
ID: 3716386 • Letter: I
Question
In C Write a recursive function that copies one directory to another. ./copy dir1 dir2 It’s must copy ALL files and directories within that source directory to the destination directory. IF the destination directory doesn’t exit, create it.In C Write a recursive function that copies one directory to another. ./copy dir1 dir2 It’s must copy ALL files and directories within that source directory to the destination directory. IF the destination directory doesn’t exit, create it.
./copy dir1 dir2 It’s must copy ALL files and directories within that source directory to the destination directory. IF the destination directory doesn’t exit, create it.
Explanation / Answer
You see, this code may work fine if you only have one subfolder. But what do you do, if there's a subfolder in that subfolder?
You need a recursive directory search function. This may look like this: