Hello,
I am trying to open using fd the full path of my file and get the name of input device.
But for some reason, the fd is not returning the file i required. I know it is a simple string manipulation but i can not figure it, can some one help??
thanks
here is my code snippet
Code:
evdev= opendir("/dev/input");
while ((Direntry= readdir(evdev)) != NULL) {
if ((fd = open("/dev/input/%s" ,Direntry->d_name, O_RDONLY)) > 0) {
ioctl(fd, EVIOCGNAME(sizeof(name)), name);
printf("Input device name: \"%s \" \n",name);
}