How can I control disk access for a specific file?

I want to use performance monitors to determine when a file is being accessed (read / write). Is it possible? If not, is there any other way? My OS is Windows Server 2008 R2 and I am writing code in C #.

+2


source to share


2 answers


For what you can use FileSystemWatcher to monitor writing to a specific file.



+1


source


Unfortunately I don't think there is an API to do this using managed code. If you need to intercept a file system read or write event, you should consider creating a filter filter . Filter drivers are pretty low-level constructs, and if it's just for performance control then it's probably not worth it. This API is often used by software developers for virus protection or backup / replication.



0


source







All Articles