Question: how to check if a directory exists in c?
Answer: 5 Answers. You could call mkdir() . If the directory does not exist then it will be created and 0 will be returned. If the directory exists then -1 will be returned and errno will be set to EEXIST .