简体   繁体   中英

Looking for a way to on passively monitor file activity in a directory in Unix C++

I have a thread I need to wake up when there is any disk-write (preferably on a specified directory). Currently I'm doing busy wait, which works, but I hoped that an interrupt will lower CPU consumption during sleep time.

The system is linux. I remember vaguely seeing such a library, but I can't find one now. help, please?

inotify可能会做您想要的。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM