C
C#9mo 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
pogrammerX9mo ago
(yes the file is in use)
JakenVeina
JakenVeina9mo 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
pogrammerX9mo ago
there are no good examples for AlphaVSS or not one that only shows shadow copying
JakenVeina
JakenVeina9mo ago
okay
Accord
Accord9mo 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.
Want results from more Discord servers?
Add your server
More Posts
✅ Help with SpotifyAPII'm trying to retrieve more than a 100 songs at once from a playlist in Spotify and I can't get it t❔ Incurable ERROR ???I am trying to Post a database strings and ints to a webpage using C# I keep getting ```System.Form❔ Converting null iteral or possible null value to non-nullable typeI'm getting this hint: ```Converting null iteral or possible null value to non-nullable type```Do I ❔ Polly - questionI have some method, but it can be quickly called multiple times and what i'm trying to do is that af✅ Could not load type 'Veylib.CLIUI.Core' from assembly 'Veylib, Version=2.5.93.0, Culture=neutral,i m getting this error ```Unhandled Exception: System.TypeInitializationException: The type initiali❔ Alive Stream requirement for DeserializeAsyncEnumerable?Does `DeserializeAsyncEnumerable` require the stream to be open (not disposed) during the whole time❔ BlazorWASM Multi-Tenant Application - Struggle with changing DbContext while RuntimeHey, I have created a Blazor WebAssembly (WASM) application, and I would like to select the Database❔ "Encryption" wont workso it says out of bounds because message can store UPTO 36 characters but isnt always 36, i dont kno❔ Optional function parameterI have this function `public void abc(Entity entity, List<string> directions, Position occupied = n❔ WPF DataGrid RowStyle DataTrigger - Doesn't Keep Default ThemeGood morning/afternoon/evening all, I am having some issues when setting a WPF DataGrid row backgro