Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hook into filesystem operations

Status
Not open for further replies.

g33man

Programmer
Dec 22, 2006
50
CA
OK, a bit ambitious here, but I want to write a "simple" app that hooks into the O/S filesystem operations. What I would like to see in my app is what files are currently being written to/read from, how much data, and what process is performing the activity. I know there are existing utilities that will give me a snapshot (e.g. Process Monitor), but I want my app to update in real-time, and only show me the most active processes. My motivation is to understand "what the heck is keeping my HD so active all the time". I hope this makes sense.
Note: what I am hoping to avoid is a polling-based solution. In other words, I don't want to ask the O/S "ok, what files are open and by whom", in a ridiculous busy loop. Instead, I'm hoping there is some way to hook into the filesystem so that it can tell me "process x just read 50 bytes from file y", "process q just wrote 200 bytes to file m", .......

I hope I'm not dreaming......

Thanks,
Mike
 

I'm not sure if this will give you everything you want, but take a look at the FileSystemWatcher Class.

I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson

Arrrr, mateys! Ye needs ta be preparin' yerselves fer Talk Like a Pirate Day!
 
Wow, the name of this class was sure promising, but when I looked into it, it appears to just be a hook into changes to the directory structure (when a file is created, renamed, deleted, etc...). There are references to system.IO, so I will start digging into this.
Thanks for the suggestion anyway.
Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top