file notifications: allow callback to be a function

(integrated from trunk branch change 2f0cd4f by Todd Whiteman <toddw@activestate.com>)