Portalocker is a library to provide an API to file locking.
On Linux and Unix systems, the locks are advisory by default. By
-o mand option to the mount command, it is possible
to enable mandatory file locking on Linux. This is generally not