How to watch disk free space change on Linux?

Posted by Bob on Super User See other posts from Super User or by Bob
Published on 2012-09-08T04:19:40Z Indexed on 2012/09/08 15:40 UTC
Read the original article Hit count: 256

Filed under:
|

As the title implies, I want to know how to watch disk free space change on Linux instead polling it periodically via statfs. When the free space is changed, a signal is emitted to allow the application having a chance to handle the change event.

On Windows, it can be done by FindFirstChangeNotification with FILE_NOTIFY_CHANGE_SIZE. When the free space is changed, the HANDLE object returend by FindFirstChangeNotification gets signaled and let application do something.

Is there any similar way to do that on Linux? Thanks.

© Super User or respective owner

Related posts about linux

Related posts about disk-space