• C

how to format floppy disk using c?

dear friends,
            i want to format floopy disk using c?
please help me.
LVL 15
jinalAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

gj62Commented:
system("format a:");

Formatting a disk is OS specific - there is no standard C call to do this...
0
akshayxxCommented:
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
rdest5Commented:
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
plusheyCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jmcgOwnerCommented:
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.