#include <sys\stat.h> |
#include <string.h> |
#include <fcntl.h> |
#include <io.h> |
int main ( void ) |
{ |
int handle; |
char buf[11] = "0123456789" ; |
/* change the default file mode from text to binary */ |
_fmode = O_BINARY; |
/* create a binary file for reading and writing */ |
handle = creat ( "DUMMY.FIL" , S_IREAD | S_IWRITE ); |
/* write 10 bytes to the file */ |
write ( handle, buf, strlen ( buf ) ); |
/* close the file */ |
close ( handle ); |
return 0; |
} |