These are brute force ideas, there's probably tidier ones...
The file is easy... try to open it readonly.
The directory is a little harder, but you could call one of the directory parsing routines such as findfirst with the same effect.
Remember to close the find and end your find correctly.
Rosalie Dieteman