P
P
Pavelgqq2016-12-17 15:34:12
C++ / C#
Pavelgqq, 2016-12-17 15:34:12

Is it possible to monitor the use of a particular file by third-party processes?

Good afternoon.
First, I will describe the system briefly. There is a certain measuring installation with control on labview. She works consistently. First, it takes a lot of measurements of the characteristics of the product, then it generates a text (.txt) file with the obtained values, then a third-party laser marking program takes values ​​from this file and marks it on the product.
Now about the problem. A third-party marking program (as its manufacturers said) waits for changes to be made to the file, and then takes the values ​​for marking from there. However, once a day, some kind of failure occurs and the installation starts printing the values ​​of the previous product.
As far as I understand, this may be due to the lack of access to the file (the file is occupied by another process and the program could not read it before marking).
And finally a question. I want to try to trace when the sign comes that the file is overwritten (and what kind of sign it is), when it becomes free from other processes and when the marking program takes data from it. This would help solve the problem. Is there a way to do this or is there a better solution?
Some kind of protection is needed against the case when the data was not considered by the marking program (say, comparing data from an overwritten file with the current data in the marking program). I have so far introduced half-measures in the form of a serial number on each product. If the marking goes astray, then two identical serial numbers come out and after that the number on the screen does not match the number on the current marked product (you can stop and restart everything, but you must first notice).

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
ins52, 2016-12-22
@ins52

1) sysinternals -> procmon
2) https://www.raymond.cc/blog/3-portable-tools-monit...
3) WinAPI: ReadDirectoryChanges https://msdn.microsoft.com/en-us/library /aa365465(...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question