foreach PID lsof -p PID | grep FILENAME and parse out the inode number stat FILENAME do the inodes match?