Artificial intelligent assistant

Why flock doesn't clean the lock file? After process is completed, I see that the lock file isn't deleted? Is there any reason that why `flock` keeps the file ? Also how does `flock` knows if there is a lock acquired ? Here is the example from a `crontab` file * * * * * flock python <script_name>.py

For most use cases of `flock`, it's very important that the lock file _not_ be "cleaned up". Otherwise, imagine this scenario:

* process A opens the lock file, finds it does not exists, so it creates it.
* process A acquires the lock
* process B opens the lock (finds it already exists)
* process B tries to acquire the lock but has to wait
* process A releases the lock
* process B acquires the lock instantly
* process A deletes the lock file
* process C opens the lock file, finds it does not exists, so it creates a new one. Note that it is now holding open a _different_ lock file that the one that process B has locked.
* process C tries to acquire the lock and succeeds... but it should have had to wait, because process B still has [a prior incarnation of] the lock file open and locked.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 9570cde870a1aad40becbc2beef28a5d