Marco Costa wrote: > Hi. > > I am trying to use inotify but something is not correct. > I am using gentoo 2006.0. > kernel: 2.6.17-gentoo-r4 > inotify is compiled in. > glibc 2.3.6-r4 > > What happens: > I initialize inotify, it returns the file descriptor (fd). OK > I add a directory to watch with all flags. It returns the watch > descriptor (wd). OK > I read (blocking) the fd. It blocks. OK > -> I touch a file inside the directory I am watching > the read unblocks, but it really returns 0 bytes read and do not block > anymore. >
Problem solved. One must read all the available data at once. Reading just chunks will not work. The use of the ioctl FIONREAD is recommended. Regards, Marco Costa
signature.asc
Description: OpenPGP digital signature