← Back to team overview

ubuntu-phone team mailing list archive

Re: [ubuntu-phone] Find SD card path

 

There'll be a vivid-based update in the coming days so this problem should
solve itself. ;)

2015-06-07 10:07 GMT+02:00 Frans Schreuder <fransschreuder@xxxxxxxxx>:

> Hello,
>
> I am developing an application which needs access to a path on the SD card:
>
>   read_path: [
>     "/media/*/*/[Mm][Aa][Pp][Ss]/"
>   ]
>
>
> In C++ I don't know the full path of the SD card, I can guess the user
> is "phablet", but the SD card ID is impossible to guess.
> if I also give access to "/media/" the solution is simple, I just create
> a  QDir and list all subdirs of /media and so on, but since I don't have
> read access, how do I find out the path?
>
> I found the class QStorageInfo which could do the job:
> QList<QStorageInfo> volumes = QStorageInfo::mountedVolumes();
>
> however this class will only be available from the Vivid image, not yet
> in 14.10 which is currently installed on most BQ Phones.
>
> Any other ideas?
>
> Frans
>
>
>
> --
> Mailing list: https://launchpad.net/~ubuntu-phone
> Post to     : ubuntu-phone@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~ubuntu-phone
> More help   : https://help.launchpad.net/ListHelp
>
>

References