How to check if the path exists and if not, create it

Hi everyone!

I'm trying to check if the path given exists. In case it doesn't, I'd like to create a folder with name given in the same directory.

Let's say path_1: "C:\folder1" and path_2: "C:\folder2", and suppose that folder1 exists but folder2 doesn't. Then if the path given by the user is the path_1, then ok, nothing happens, but if it is the path_2, then the programm should realize that it doesn't exist in the C:\ and should ask you whether you want to create it or not.

If someone can help with all that stuff, great, if not, it would be almost enough just to now how to check if the path/folder exists or not.

I know that it's possible to check the existence from files (with fopen it's possible do to that), but I don't know how to do that for folders!
Last edited on
Topic archived. No new replies allowed.