如何在进程使用文件时将文件复制到另一个文件夹
How to copy a file to another folder while a process is using it
如何将正在用于另一个进程的任何文件复制到指定文件夹,而不影响/破坏该进程正在执行的操作?
上下文:我正在制作一个程序,每 X 分钟将一个项目文件夹复制到 2 个云服务器和 1 个硬盘驱动器,同时该项目仍处于打开状态。
如下文post所述:
The important part is the FileShare.ReadWrite when opening the
FileStream
.
How to copy a file while it is being used by another process
简而言之,确保您在打开文件时指定了正确的访问参数。
如何将正在用于另一个进程的任何文件复制到指定文件夹,而不影响/破坏该进程正在执行的操作?
上下文:我正在制作一个程序,每 X 分钟将一个项目文件夹复制到 2 个云服务器和 1 个硬盘驱动器,同时该项目仍处于打开状态。
如下文post所述:
The important part is the FileShare.ReadWrite when opening the FileStream
.
How to copy a file while it is being used by another process
简而言之,确保您在打开文件时指定了正确的访问参数。