#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdlib.h>

main()
{
int fd;

	printf("I am here\n");
	if((fd = open("/dev/mydevice",O_RDWR)) < 0){ 
		printf("cannot open device\n");
		exit(-1);
	}
	else{
		printf("device is opened\n");
		close(fd);
		printf("device is closed\n");
	}
}
