A_kumar
A_kumar

Reputation: 411

How to find files and folders in MAC volume using App sandboxed application

I am creating a sand-boxed application on MAC(10.9).When App Sand-boxed is off then i am able to get files and folders from any path. But when I does App Sand-boxed enabled it's not accessing any files and folders from any path. Getting file and folder from path ("/Volumes/DriveName" or "/" etc.) when App Sand-boxed is off using Qt 5.0

// for folders

    QStringList folderlist;
       QDir curDir = QDir(path);   
       curDir.setFilter(QDir::Dirs);
       QFileInfoList list = curDir.entryInfoList();
       for(;<list.size;)
        {
             QfileInfo fileInfo = list.at(i);
             folderList << fileInfo.filePath();
        }
    // for files
    QStringList filelist;
        QDirIterator dirIn(path,filterfiles,QDir::AllEnteries);
        while(dirIn.hasnext())
    {
     dirIn.next();
    QfileInfo fileInfo = dirIn.fileInfo();
             filelist<< fileInfo.filePath();
    }

    What i do same when App sand-boxed is enabled?  

Upvotes: 0

Views: 279

Answers (1)

TheDarkKnight
TheDarkKnight

Reputation: 27611

That's the point of a sandbox, you can only access resources within the sandbox. A user may add files to the sandbox, but that requires your application to launch a file open dialog box, so they can choose the file they want to work with.

I suggest you start by reading the Apple documentation here.

Upvotes: 2

Related Questions