Use the base name of the named pipe for the created temp file

This commit is contained in:
Kovid Goyal 2025-05-03 16:03:06 +05:30
parent 7ef2fe53e0
commit b5cbb501a4
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C

View file

@ -50,7 +50,7 @@ func resolve_path(path string) (ans string, is_dir bool, err error) {
return
}
defer src.Close()
if dest, err = os.CreateTemp("", fmt.Sprintf("*-pipe-%d", len(temp_files)+1)); err != nil {
if dest, err = os.CreateTemp("", fmt.Sprintf("*-pipe-%s", filepath.Base(path))); err != nil {
return
}
defer dest.Close()