Qt WinRT Folder Permission Issue

馋奶兔 提交于 2019-12-12 02:49:31

问题


Hi I already posted a question Qt WinRT App cannot access file permission denied regarding ffmpeg library and video file read, and now I think the entire project should have some permission to access/modify the files system in WinRt Qt App.

Below is a simple code which create a directory if not exist, bu this also failing always, so I think it permission issue, and there are something should add on AppxManifest.xml.

QString dirname = QDir::homePath()+"/test";
    QDir dir(dirname);
    if(!dir.exists())
    {
        //dir.mkdir(dirname);
        if(false==dir.mkpath(dirname)){
            qDebug()<<"Creating "<<dirname<<" failed...";
        }
    }

Anyone have faces this before, any suggestion, tips ..

Thanks in Advance. Haris


回答1:


WinRT as a platform will not allow you to "simply" create files outside the sandbox of the application. There are certain directories you can use (Media, Photos, ...) in case you have the correct capability set. And even then you will only be allowed to open/create/read/write files selected by the file picker.



来源:https://stackoverflow.com/questions/35560994/qt-winrt-folder-permission-issue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!