Skip to content

Commit

Permalink
Temporary file should be opened with FileMode.Create instead of FileM…
Browse files Browse the repository at this point in the history
…ode.CreateNew. Fixes #16
  • Loading branch information
gdivis committed Jan 14, 2019
1 parent 6b921d3 commit 04c2d89
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Inedo.UPack/Packaging/UniversalPackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public UniversalPackage(Stream stream, bool leaveOpen)

if (!stream.CanSeek)
{
var tempStream = new FileStream(Path.GetTempFileName(), FileMode.CreateNew, FileAccess.ReadWrite, FileShare.None, 4096, FileOptions.DeleteOnClose);
var tempStream = new FileStream(Path.GetTempFileName(), FileMode.Create, FileAccess.ReadWrite, FileShare.None, 4096, FileOptions.DeleteOnClose);
stream.CopyTo(tempStream);
if (!leaveOpen)
stream.Dispose();
Expand Down

0 comments on commit 04c2d89

Please sign in to comment.