I want to open a file using Erlang but I want this file locked as long as it is opened. Every time I use the below code for opening the file I am able to delete with no problem