C
C#15mo ago
pogrammerX

❔ Copy a file thats in use (using Shadow Copy or something)

Can someone please help me get this code to shadow copy?
private string CopyToTempFile(string sourceFilePath)
{
string destinationFilePath = GetTempFilePath();
while(File.Exists(destinationFilePath))
destinationFilePath = GetTempFilePath();


return destinationFilePath;
}
private string CopyToTempFile(string sourceFilePath)
{
string destinationFilePath = GetTempFilePath();
while(File.Exists(destinationFilePath))
destinationFilePath = GetTempFilePath();


return destinationFilePath;
}
5 Replies
pogrammerX
pogrammerXOP15mo ago
(yes the file is in use)
JakenVeina
JakenVeina15mo ago
Stack Overflow
Programmatically copy in-use files
In my C# code I want to be able to use some Shadow Copy mechanism in order to copy files that are being used by another process. I've seen that solutions exist on the web, in enterprise or command...
pogrammerX
pogrammerXOP15mo ago
there are no good examples for AlphaVSS or not one that only shows shadow copying
JakenVeina
JakenVeina15mo ago
okay
Accord
Accord15mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.

Did you find this page helpful?