Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 244
  • Last Modified:

how to format floppy disk using c?

dear friends,
            i want to format floopy disk using c?
please help me.
0
jinal
Asked:
jinal
1 Solution
 
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
 
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

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now