How could i know that files be opened in a specified directory?

I have some difficulites at work,because i must handle the files in a
specified directory, when the files were opened then the action was
failed. How could i know that files be opened
before dealling the files in the directory?

Just opened the directory that would be handled, got the fileobject of the
directory and FCB,referenced to the OpenCount?

Thanks for any hints.