Given a path of the directory, we have to check whether the directory exists or not.
The source code to check a specified directory exists or not is given below. The given program is compiled and executed using GCC compile on UBUNTU 18.04 OS successfully.
// C program to check a specified directory
// exist or not
dObj = opendir("./image");
if (dObj != NULL)
printf("Directory does not exists.\n");
Here, we checked directory "image" exists in the current directory or not. Then print the appropriate message on the console screen.
total answers (1)
start bookmarking useful questions and collections and save it into your
own study-lists, login now to start creating your own collections.