How to check if file is in use?

by Shortman   Last Updated August 10, 2018 10:12 AM

I have c++ application and I need to know if one file is in use by anyone. I'm ok with running any command, but I don't want to run lsof command for this purpose, since I think I can't safely assume that lsof will be available on all OS, or can I safely assume that?

EDIT: Is there any way to do this without the need of root privileges?

Related Questions

How do I uninstall the command line tools for Xcode?

Updated December 13, 2017 22:12 PM

How to send an email from command line?

Updated October 05, 2017 12:12 PM

Running .NET binary with mono

Updated September 25, 2017 13:12 PM