How to automatically delete files when they are deleted by users

I am running CE 9.x with local file storage and can’t quite figure out how to purge files when they are deleted via API. I have found http://www.oodlestechnologies.com/blogs/configuring-the-script-for-removing-deleted-videos-in-Kaltura-CE4 but I am not entirely sure it is relevant. Any advice is appreciated.