Does CopyFile and CopyFileEx work if the source file is open?

I want to call the copyFile function from the source file that I want to copy. The VBA FileCopy function does not allow you to open the source file while it is being copied. I am thinking of using CopyFile or CopyFileEx (to show a progress bar).

Therefore, do these functions work if the source file is open?

+3
source share
1 answer

Yes, CopyFileEx () has a COPY_FILE_OPEN_SOURCE_FOR_WRITE parameter that allows you to copy a file that has been opened for writing. You still need cooperation from the owner of the file, he would have to open a file that allows access to read.

, , , , , , . . , , ​​, . - .

+2

Source: https://habr.com/ru/post/1736356/


All Articles