简体   繁体   中英

Copy a changing file with File.Copy

I'm writing some sort of backup tool that has to copy all the files in a directory. Now I'm using C#'s File.Copy(String, String, Boolean) method. But another application (which I can't change) simultaneously writes to the files in that directory.

So now I wonder if it is possible that a file gets changed halfway the copying process creating a corrupt backup file?

Thanks

No, it is not. Underlying file system will make sure this is not happening.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM