Use FileExists statement. If the file is locked for reading, it will return False. If you want to verify that the file actually exists, but locked, use Dir and check for file name in the output list. There is no way to check whether a file is locked for writing before trying to write to it. In such situations you can enable "ignore errors" and do all error handling yourself, i.e. FileOpen..., "WRITE", ...; IfThen handle, DO_IT : How i can know if a file is opened by another job?
|