Formatting Hard disk in C++ on Linux

I'm trying to make a program to format Hard Disk and now I'm stuck with the code of the formatting I searched and I found SHFormatDrive() but I found that function is supported for win xp and later and I couldn't find away to use it any help!

Answers


The typical way you do things like this in UNIX is to use the library call system(const char*) to call a command-line utility to do it for you.

Of course, you need proper permissions, etc.

The other way, of course, is to find the open-source formatting code (e.g. mkfs.ext3) and add it to your project (following the licensing requirements, of course).


Need Your Help


About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.