C Language Development Kit/Functions/Format2
From OptiWiki
| Description | This function deletes all files on the specified drive. | ||||||||
| Syntax | void format2(unsigned char drive); | ||||||||
| Arguments | drive specifies the drive to format. The following constants are defined for this:
unsigned char drive
| ||||||||
| Returns | None | ||||||||
| Remarks | This function is almost identical to the format function, with one difference.
Where format uses the default drive, you should specify the drive with this function. | ||||||||
| Example | #include <stdio.h> #include <stdlib.h> #include "lib.h" void main( void ) { static char data[20+1]; FILE *fp; while( 1 ) { printf("\f1: mem = %lu", coreleft()); if( NULL != ( fp = fopen("TEST.DAT", "wb"))) { fwrite( data, 1, 20, fp); fclose(fp); } while( getchar() == EOF ) idle(); printf("\f2: mem = %lu", coreleft()); format(); while( getchar() == EOF ) idle(); printf("\f3: mem = %lu", coreleft()); while( getchar() == EOF ) idle(); } } |
