?
Solved

how to format floppy disk using c?

Posted on 2003-03-14
6
Medium Priority
?
240 Views
Last Modified: 2010-04-15
dear friends,
            i want to format floopy disk using c?
please help me.
0
Comment
Question by:jinal
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 6

Expert Comment

by:gj62
ID: 8140751
system("format a:");

Formatting a disk is OS specific - there is no standard C call to do this...
0
 
LVL 8

Expert Comment

by:akshayxx
ID: 8141854
you want to format the floppy using C?
OR
you want to write source code in C for formatting the floppy? // i mean implement the format command ?
0
 

Expert Comment

by:rdest5
ID: 8143728
both gj62 and akshayxx are correct...

However, asuming you are developing this on win32 platform and the "format" executable is in your applications PATH variable you could use a system call to format the drive desired...

i.e.

printf("enter drive letter to format: ");
gets(drive)

sprintf(command, "format %s", drive);
system(command);

...

this is very specific to win32.. what OS are you using and is this close to what you are trying to do...

rdest5
0
 

Accepted Solution

by:
plushey earned 150 total points
ID: 8146708
I did this a long time ago.

You need to call a ROM-BIOS interrupt, I haven't got the exact details to hand that I used but I remember that I also had to code a few functions in assembler, that might not be necessary these days.

There are functions around like intdos(), int86(), int86x(), bdos() etc...

If you have MS C 6.0 then there is also a function _bios_disk() see http://www.clipx.net/ng/msc60/ngb6415.php for more details.
0
 
LVL 20

Expert Comment

by:jmcg
ID: 10131979
Nothing has happened on this question in more than 9 months. It's time for cleanup!

My recommendation, which I will post in the Cleanup topic area, is to
accept answer by plushey [grade B] (a hint, not a solution).

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

jmcg
EE Cleanup Volunteer
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question