1

I need to check when a specific application (that I known) access to a specific file (that I know)

In short I need to hook an external application to see when start to play a scecific wav file.

I like to track "before" or "during" but not "after" play the file.

To try to do it, I have imported this code on a console application:

Github Code

to do a test I have inserted this code;

var list = DetectOpenFiles.GetOpenFilesEnumerator(4780);
while (list.MoveNext())
    Console.WriteLine(list.Current.FullName);

on main module where 4780 is the PID of a mediaplayer that play a wav file.

At debug (list.Current.FullName) I see only the file dependence but don't show me the wav file opened.

After show the first 2/3 debug lines the application crash (out of memory).

If I press F5 without debug the application crash (out of memory).

There is an easy to track when an external application play a specific wav file ?

Lucifer
  • 1,594
  • 2
  • 18
  • 32
  • 1
    Maybe you will get the answer here: https://stackoverflow.com/questions/317071/how-do-i-find-out-which-process-is-locking-a-file-using-net – miciry89 Dec 31 '19 at 12:25
  • thank you ! but this post seem relative to file lock and is not exact the some thing, I need to know when a application access to a file with or without lock the file. –  Dec 31 '19 at 12:46

0 Answers0