How can I tell if a file is locked in Unix?

How can I tell if a file is locked in Unix?
Answer
How do you check if a file is still being written in Unix? You can
use lsof | grep /absolute/path/to/file.txt to see if a file is open. If the file is open, this command will return status 0, otherwise it will return 256 (1).
 

Tìm kiếm

Back
Top