How to lock a file?

question

#1

How to lock a file from julia? This came up here.