CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: File Accessing

  1. #1
    Join Date
    Apr 1999
    Posts
    6

    File Accessing

    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


  2. #2
    Join Date
    May 1999
    Location
    Oregon, USA
    Posts
    302

    Re: File Accessing

    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.




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured