Nadarian
Nadarian

Reputation: 1002

QDir mkpath doesn't create directory on android

Every time I launch application, mkpath is called as if the directory was not created previously despite I always get 'path created' log. Do I need to specify any special privileges to save into the internal storage? mypath looks like /data/data/org.qtproject.example.WierszeApp/files/.local/share/libWierszeApp.so/

QDir mypath(QStandardPaths::writableLocation(QStandardPaths::DataLocation));

if(!mypath.cd("images"))
{
    if(mypath.mkpath("images"))
        qDebug() << "path created";
    else
        qDebug() << "path not created";
}
else
{
    qDebug() << "inside dir";
}

Upvotes: 3

Views: 1189

Answers (1)

Nadarian
Nadarian

Reputation: 1002

I figured out why it appeared to not be created every time. Each time I run application from QtCreator libWierszeApp.so folder was deleted, so was the content. When you run app from the device everything works fine. I think it can be reported as bug.

Upvotes: 3

Related Questions