#include <sys\stat.h>
#include <string.h>
#include <stdio.h>
#include <fcntl.h>
#include <io.h>
int main(void)
{
int handle;
char msg[] = "This is a test";
char ch;
handle = open("DUMMY.FIL",O_CREAT | O_RDWR,S_IREAD | S_IWRITE);
write(handle, msg, strlen(msg));
lseek(handle, 0L, SEEK_SET);
do
{
read(handle, &ch, 1);
printf("%c", ch);
}while (!eof(handle));
close(handle);
return 0;
}