tags:

views:

698

answers:

2

Quick question: In Qt (C++), how do I check if a given folder exists in the current directory? If it doesn't exist, how do I then create an empty folder? I couldn't seem to find any references online for it (or in qt's help)

Thanks.

+9  A: 

To check if a directory named "Folder" exists use:

QDir("Folder").exists();

To create a new folder named "MyFolder" use:

QDir().mkdir("MyFolder");
Kyle Lutz
A: 

Why use anything else?

  mkdir(...);
matiasf