How to create a directory using QT (QDir) in Linux?
<p>I have been trying to create a directory in root directory of Linux. But as I am not much familiar with Linux platform I am unable to write the correct program in QT. Can you please have a look at my code and tell me where did I did mistake?</p>

<pre><code>#include &lt;QCoreApplication&gt;
#include &lt;QDebug&gt;
#include &lt;QDir&gt;
#include &lt;QString&gt;

int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);
QDir mDir;
QString mpath="/home/qtfile";
if (!mDir.exists(mpath))
{
    mDir.mkpath(mpath);
    qDebug() &lt;&lt;"Created";
}
else if (mDir.exists(mpath))
{
    qDebug() &lt;&lt;"Already existed";
}
else
{
    qDebug()&lt;&lt;"Directory could not be created";
}
return a.exec();
}
</code></pre>

<p>Thank you for your time and consideration</p>

<p>EDIT:- Thank you everyone. Now this problem is solved</p>