[LCP]How to tell if a file is open?

Mike & Penny Novack stepbystepfarm at shaysnet.com
Sat Sep 22 00:17:40 UTC 2001


>
> If these two steps are interrupted then some other program may just
> acquire an exclusive lock just as you've determined it is safe to do
> exactly that, then this logic will fail and it won't be immediately
> obvious why.
>
> Of course this isn't a problem on a single user system (but then the
> original question is also irrelevant on a single user system.)
>

Ah but it is (still a problem). Just because the system has only a
single (human) user does not mean that there can't be any number of
concurrent tasks going on. The probablity of the problem actually
manifesting may be small but finite. And if it ever does happen, good
luck! (very hard to debug since not reproducable).

Mike




More information about the linuxCprogramming mailing list