Inotify_add_watch usage notes

Source: Internet
Author: User

1. inotify_add_watch does not return an FD, but an identifier.
2. For the same path, inotify_add_watch returns the same identifier. You do not need to call close, but you need to call inotify_rm_watch to delete it.

Pay attention to this feature when reading, writing, and disabling monitoring files. However, inotify_init returns a real FD, so you need to call close to close it.
However, if the path is the same but the path is alternating by add and RM, it will not be repeated and will increase from 1.
Add_watch is performed on the same path before the previous one is RM. Actually, it is only modified and the return value will not change.


More attention: http://bbs.hadoopor.com/thread-1852-1-1.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.