Hi,

I have an application which writes some data to a file (csv). Now there is python script which is to be invoked once the application writes to the file. The application cannot generate any indication of completion of the process.

I thought of opening that csv file and handling the error for opening a file which is already in use. But I tested that if i open a file, and try to open the same file in write mode using the python, it does not throw any error of locking etc.

Please let me know how can I handle this logic in python.

It will be a great help !!!

Regards,

You can use "lsof" (list open files) but that gives a huge amount of data since it will list any and all system files, etc. as well.

The application cannot generate any indication of completion of the process.

Why not? That is the standard way of doing things. Processes are meant to be independent and were designed with that in mind. If you want inter-process communication you will have to design it in.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.