Skip to content

Commit

Permalink
Generate a more random temporary file name.
Browse files Browse the repository at this point in the history
  • Loading branch information
dlemstra committed Sep 19, 2023
1 parent ac5f424 commit 0abd9fd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Magick.NET/Helpers/TemporaryFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ internal sealed class TemporaryFile : IDisposable
private readonly FileInfo _tempFile;

public TemporaryFile()
=> _tempFile = new FileInfo(Path.GetTempFileName());
=> _tempFile = new FileInfo(Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()));

public long Length
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Magick.NET.Tests/TestHelpers/TemporaryFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class TemporaryFile : IDisposable

public TemporaryFile(byte[] data)
{
_file = new FileInfo(Path.GetTempFileName());
_file = new FileInfo(Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()));
System.IO.File.WriteAllBytes(_file.FullName, data);
}

Expand Down

0 comments on commit 0abd9fd

Please sign in to comment.