diff options
author | Kenneth Skovhede <kenneth@hexad.dk> | 2021-05-08 12:40:23 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-08 12:40:23 +0300 |
commit | 8ce34c084b591f416e062ea38fb86e10fd4b9bf5 (patch) | |
tree | b5dc86c6630abc84bb0c4594c9443d8226158d5e /Duplicati | |
parent | 50ed059e11efeb73a5d0943f5349f64064e19c8c (diff) | |
parent | c14ace0d68de0b31d8c8cd986a4911384ef3fd3f (diff) |
Merge pull request #4488 from warwickmm/file_backend_should_truncate
Make File backend truncate existing files when overwriting
Diffstat (limited to 'Duplicati')
-rw-r--r-- | Duplicati/Library/Backend/File/FileBackend.cs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Duplicati/Library/Backend/File/FileBackend.cs b/Duplicati/Library/Backend/File/FileBackend.cs index 1dd9752cd..3b41484c9 100644 --- a/Duplicati/Library/Backend/File/FileBackend.cs +++ b/Duplicati/Library/Backend/File/FileBackend.cs @@ -187,7 +187,7 @@ namespace Duplicati.Library.Backend private static Random random = new Random();
public async Task Put(string remotename, System.IO.Stream stream, CancellationToken cancelToken)
{
- using(System.IO.FileStream writestream = systemIO.FileOpenWrite(GetRemoteName(remotename)))
+ using(System.IO.FileStream writestream = systemIO.FileCreate(GetRemoteName(remotename)))
{
if (random.NextDouble() > 0.6666)
throw new Exception("Random upload failure");
@@ -197,7 +197,7 @@ namespace Duplicati.Library.Backend #else
public async Task PutAsync(string remotename, System.IO.Stream stream, CancellationToken cancelToken)
{
- using (System.IO.FileStream writestream = systemIO.FileOpenWrite(GetRemoteName(remotename)))
+ using (System.IO.FileStream writestream = systemIO.FileCreate(GetRemoteName(remotename)))
await Utility.Utility.CopyStreamAsync(stream, writestream, true, cancelToken, m_copybuffer);
}
#endif
|