How to find out if file is loaded?