Quantcast
Channel: Security forum
Viewing all articles
Browse latest Browse all 12072

Windows 2008 R2 SP1 Standard Edition, MoveFileEx issue

$
0
0

Hi,

In our applciation, we are using MoveFileEx to rename a directory.

I have pasted below a part of the code that uses MoveFileEx function to move a directory.

if (0 != ::_waccess (tempCopyDir, 0) ||
               ::MoveFileEx (tempCopyDir, destDir, MOVEFILE_WRITE_THROUGH)) ret = 0;
   else {
    Sleep(10);
    if (0 != ::_waccess (tempCopyDir, 0) ||
               ::MoveFileEx (tempCopyDir, destDir, MOVEFILE_WRITE_THROUGH)) ret = 0;
     else ret = -1;
   }

What I see is that this function does not succeed to rename the directory all the time. There is already a delay added in the code and the same function is called second time. Still, the directory does not get renamed. This is intermittent. The folder does not have access issue as I am able to copy/rename files/folders in this path.

Can anyone help me understand why this is so and is there any solution for this issue?

Thanks.

Nag


Viewing all articles
Browse latest Browse all 12072

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>