I'm looking for a command line function or c function that will let me know if a file is open/in use by something.
lsof
and fuser
do tell this, but they provide a lot of other info which results in taking up to 300ms in some situations (like when i use this code on MAC OS X, I'm devving for Linux and OS X) (I have a windows solution that takes 5ms so I'm trying to find something in Unix that also is very quick, and just returns true or false if file is in use)