[Tutor] intercepting and recored I/O function calls

Alan Gauld alan.gauld at btinternet.com
Wed Sep 15 23:37:33 CEST 2010


"Jojo Mwebaze" <jojo.mwebaze at gmail.com> wrote

> I would like to intercept and record I/O function calls to a file.. 
> (later
> to a database) with probably the names of the files that have been 
> created,
> accessed / deleted in my program. I  have not done something like 
> this
> before.. Some Guidance is highly appreciated

Are you talking about I/O calls in your own app? If so thats fairly
straightforward to do. OTOH If you are talking about capturing all
I/O calls that's a lot harder.... and if it's a multi-user OS will 
need
administrator privileges.

But this is extremely dependant on the Operating System - you will 
basically
have to intercept the system calls. So, which OS are you using?
And how familiar are you with its API?

Al;so, While you can probably do this in Python but its likely to have
a serious impact on the OS performance, it will slow down the 
performamce
quite noticeably. I'd normally recommend using C for something like 
this.

HTH,

-- 
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/




More information about the Tutor mailing list