in reply to Monitoring when a file opened

perl can do fcntl(2). Leases are activated with the F_SETLEASE parameter. I have not tried using that parameter with perl, but I do not see why it cannot be sent. If you use Fcntl; and the lease constants are not there, you may have to add them or upgrade your perl.

Leases began somewhere in 2.4 so they are not in older linuxes.

HTH, --traveler