Provide an API for controling file locking

I’ll continue this conversation over in New vs Old Documentation URLs . I think that patch may help.