#include <string.h> |
#include <stdio.h> |
#include <errno.h> |
#include <dos.h> |
#include <io.h> |
int main ( void ) |
{ |
int handle; |
char buf[11] = "0123456789" ; |
/* attempt to create a file that doesn't already exist */ |
handle = creatnew ( "DUMMY.FIL" , 0 ); |
if ( handle == -1 ) |
printf ( "DUMMY.FIL already exists.\n" ); |
else |
{ |
printf ( "DUMMY.FIL successfully created.\n" ); |
write ( handle, buf, strlen ( buf ) ); |
close ( handle ); |
} |
return 0; |
} |