Click to See Complete Forum and Search --> : File Accessing


Uri
April 14th, 1999, 03:03 PM
I have two application A and B. A initiates process B, and exits. Process B should move (or copy) some files, which are Dll's (or Exe) that are part of A. The problem is that I get file access or sharing problems writing on A's Dlls.

Is there a way to find out when a file is free from other application access? or to know when a given process (I have the PID of A) has finished completely?

Thanks

Gomez Addams
April 14th, 1999, 03:25 PM
Try to open the file for exclusive access (not shared).
You can also put this in a loop that tries several times and
sleeps between tries to give it a chance to release the files.
You can call GetExitCodeProcess to see if it has exited.