Check File Permissions and Usage

  • Thread starter Thread starter John Wright
  • Start date Start date
J

John Wright

I have a program that needs to update a file at times. Is there a way to
check to see if the file is in use and force an update on the file. The
file I need to update is not used by anyone, but a process on the machine
may have had it open and not released it. Any suggestions are appreciated.

John
 
John Wright said:
I have a program that needs to update a file at times. Is there a way to
check to see if the file is in use and force an update on the file. The
file I need to update is not used by anyone, but a process on the machine
may have had it open and not released it.

You may want to delay moving the file until the next reboot of the system:

Platform SDK: File Systems -- 'MoveFileEx'
<URL:http://msdn.microsoft.com/library/en-us/fileio/base/movefileex.asp>

+ 'MOVEFILE_DELAY_UNTIL_REBOOT'.

How To Move Files That Are Currently in Use
<URL:http://support.microsoft.com/?scid=kb;EN-US;140570>
 
Back
Top