69,373
社区成员
发帖
与我相关
我的任务
分享
#include <string.h>
#include <stdio.h>
#include <fcntl.h>
#include <dos.h>
int main(void)
{
int handle;
unsigned nbytes;
char msg[] = "Hello world\n";
if (_dos_open("TEST.$$$", O_RDWR, &handle) != 0) {
perror("Unable to open TEST.$$$");
return 1;
}
if (_dos_write(handle, msg, strlen(msg),&nbytes) != 0)
perror("Unable to write to TEST.$$$");
printf("%u bytes written to TEST.$$$\n",nbytes);
_dos_close(handle);
return 0;
}