Re: My way to check if a progam is already running



On Jun 21, 12:00 pm, Jan Panteltje <pNaonStpealm...@xxxxxxxxx> wrote:

Ok I see your point, but all this file locking is it not more complicated
then the 10 lines of code at the start of main() that I proposed?
Especially as many files (not just one) are involved?

Your solution has several defects.

1) It breaks if the name of the program is changed or the program is
accessed under another name.

2) It breaks if another program is ever added that manipulates the
same data.

3) It prohibits multiple operations of the same program, even if they
are on different data sets.

Locking the thing that must not change makes more logical sense.

DS

.