[erlang-questions] Check for file used by any process

Maruthavanan Subbarayan <>
Tue Jun 12 12:44:55 CEST 2012


Hi,
Is there any BIF where I can check whether a file is used by any other process?
I have the below scenario. A directory being watch at a regular interval, I have to process the file only if that is being written fully.
If some other process is writing the file, I should check and avoid those. 
How can I achieve this. I can do as os:cmd("lsof | grep <filename>"). But wanted to check is there any other way I can check that in Erlang BIF.
Thanks,Marutha 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20120612/ee7d2a0b/attachment.html>


More information about the erlang-questions mailing list