0

How can I get the partition id in Qt?

I'm searching for a good way to keep file directory without the partition name

For example, I want to save the directory of a file that is in my flash memory. in my computer maybe it's "Local Disc (F:)", and in another computer maybe it's "Local Disc (G:)", and if I keep the file directory with local disc name, i'm in a wrong way.

That's because i'm searching for another way, and I want to get the partition id and save the directory with partition id.

Can anyone help? Does anyone have a better idea? :)

I'm trying to do it in linux and windows.

ypnos
  • 50,202
  • 14
  • 95
  • 141
Amir eas
  • 121
  • 2
  • 10

1 Answers1

0

Every used the QFileInfo class? You can use that to get the absolute path and then cut the resulting string on the first / and you will be left with the partition only.

dtech
  • 47,916
  • 17
  • 112
  • 190
  • Thank you, but I want to save the path without driver name just when it is in a portable device, if my directory be in my pc drivers, I want to save the full path. how can i make a difference between two things? – Amir eas Apr 04 '13 at 08:45