Skip to content

Commit

Permalink
WindowsSignaler generates its own temp filename instead of using GetT…
Browse files Browse the repository at this point in the history
…empFileName

GetTempFileName create 0 size temp files to ensure availability of the generated temp filename, which are not removed when the WindowsSignaler is disposed. Instead we simply create our unique temp filenames using UUID, and thus we only create the actual temp (.exe) file that we actually need.
  • Loading branch information
xpherism committed Sep 19, 2024
1 parent 68bda90 commit 97770a4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion CliWrap/Utils/WindowsSignaler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ internal partial class WindowsSignaler
public static WindowsSignaler Deploy()
{
// Signaler executable is embedded inside this library as a resource
var filePath = Path.ChangeExtension(Path.GetTempFileName(), "exe");
var filePath = Path.Combine(Path.GetTempPath(), $"{Guid.NewGuid()}.exe");
Assembly.GetExecutingAssembly().ExtractManifestResource("CliWrap.Signaler.exe", filePath);

return new WindowsSignaler(filePath);
Expand Down

0 comments on commit 97770a4

Please sign in to comment.