Why do you want to know this if you don't want to access the file? It
wouldn't make sense to check if the file is locked before accessing it
because between the check and the access another process might have opened
it, so the positive check would lead to an exception when accessing the file
anyway.