How to determine if a file is in use