My app downloads fil开发者_高级运维es, creates files as final/intermediate data. I would like to setup a hook (outside the app), to alert/log whenever my app does any I/O events - like writing a file, deleting a file, downloading a file from the file server. I use the urllib to retrieve fits files from the data servers.
If you know where the file will be downloaded to, one solution could be to use inotify. In particular, pyinotify seems interesting. I don't know if CentOS has a recent enough version of the Linux kernel for this to work though.
If you want a list of your process file operations, you can use FileMon or ProcMon from SysInternals.
Edit: for Linux, you can use strace.
精彩评论