Formatting New Linux Filesystems Using Qt
-
wrote on 13 Jun 2011, 10:54 last edited by
I have had a Google around and a search on Qt DevNet but haven't been able to find an answer to the following.
Suppose I wanted to create a tool used to format removable drives in Qt - does Qt provide a library which gives the fnctionality to format new filesystems?
If not what is the recommended way of doing this from within a Qt application in Linux?
-
wrote on 13 Jun 2011, 11:01 last edited by
Well, as far as I know, Qt doesn't provide that functionality. But, you could take a look at GParted, which uses "GNU/Parted":http://www.gnu.org/software/parted/ at the backend. Its a great tool which comes bundled with Ubuntu Live CD. You could install it from synaptic to take a look. Take the lead from there to make a Qt application instead of GTK.
bq. GNU Parted manipulates partition tables. This is useful for creating space for new operating systems, reorganizing disk usage, copying data on hard disks and disk imaging. The package contains a library, libparted, as well as well as a command-line frontend, parted, which can also be used in scripts.
-
wrote on 13 Jun 2011, 11:18 last edited by
Or look at "http://qtparted.sourceforge.net/" :)
-
wrote on 13 Jun 2011, 11:24 last edited by
Of course, there would already be an app doing it using Qt :).. Just a comment, the sourceforge link opens up, but not the link to a forum thread in the link (http://developer.qt.nokia.com/forums/viewthread/6762/QtParted).
-
wrote on 13 Jun 2011, 11:30 last edited by
Fixed the link but it I'm not sure what happened, it look ok.
-
wrote on 13 Jun 2011, 11:33 last edited by
You could also call the usual command line applications mkfs.* via QProcess.
-
wrote on 13 Jun 2011, 11:41 last edited by
ZapB: Probably the simplest!
-
wrote on 13 Jun 2011, 12:00 last edited by
Or you could just take the same approach that the above mentioned applications took and use libparted directly.
Here is a tutorial for libparted Note: example's may need to be justed to fit the current api.
LibParted Handbook "Note: LibParted is a library used to create, destroy, resize and copy PC disk partitions"
http://zester.googlecode.com/files/libparted_handbook.pdfHere is the libparted API reference
http://www.gnu.org/software/parted/api/
And if you want to work directly with just CD/DVD drives
Libburn
http://api.libburnia-project.org/libburn
Libisofs
http://api.libburnia-project.org/libisofs
Libisoburn
-
wrote on 13 Jun 2011, 12:04 last edited by
Some great replies, thanks for the informationall, gives me plenty to be looking at :-)
-
wrote on 13 Jun 2011, 12:17 last edited by
I forgot to mention that libparted is a bit on the lowlevel side so for getting disk information you might want to
use QtMobility http://doc.qt.nokia.com/qtmobility-1.1.3/systeminfo.html with libparted. If thats the approach
that you decide to take. -
wrote on 13 Jun 2011, 12:20 last edited by
Hmm.. But mobility classes are only for mobile platforms?
-
wrote on 13 Jun 2011, 12:21 last edited by
Nope. QtMobility has some features for all platforms mobile and desktop.
-
wrote on 13 Jun 2011, 12:24 last edited by
No you can use them on a regular desktop also. There are some classes/functions that might not make sense for the desktop like the tilt sensor API but it might be relevant for a tablet.
-
wrote on 13 Jun 2011, 12:27 last edited by
bq. QtMobility has some features for all platforms mobile and desktop.
I didn't know that because i'm on desktop only until now. That's good news.Is there a web page/link where we can see a list of the goodies available for desktop?
Or how can we determine (without prior qtmobility knowledge) which ones are accesible for desktop? -
wrote on 13 Jun 2011, 12:29 last edited by
One could use the
@
QFSFileEngine::drives ()
or
QDir::drives ()
@I'm not sure how much of mobility is supported on the desktop. It is still quite early for that kind of support. I may be wrong though. But, for example, the Camera API doesn't use the webcam on desktop.
-
wrote on 13 Jun 2011, 12:33 last edited by
bq. But, for example, the Camera API doesn’t use the webcam on desktop.
Actually you just might be wrong there I do know that the QtMobility Multimedia Library has been moved to
to Qt 4.8 I think and if I am not mistaken there is a webcam api in there. I will have to test that on my system. -
wrote on 13 Jun 2011, 12:36 last edited by
bq. Actually you just might be wrong there I do know that the QtMobility Multimedia Library has been moved to
to Qt 4.8 I think and if I am not mistaken there is a webcam api in there. I will have to test that on my system.In that case.. my bad, still with 4.7.3/4 here :P, working on the official SDK 1.1 for deploying to OVI store.
1/17