From a8c248196751237932e8d6acc21cce5adc939c60 Mon Sep 17 00:00:00 2001 From: "alex.sharov" Date: Sun, 9 Jan 2022 14:52:52 +0700 Subject: [PATCH] create huffman_codes.txt in tmpdir --- compress/parallel_compress.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compress/parallel_compress.go b/compress/parallel_compress.go index b11922696..32bb5e8a6 100644 --- a/compress/parallel_compress.go +++ b/compress/parallel_compress.go @@ -595,7 +595,9 @@ func reducedict(logPrefix, tmpFilePath, dictPath, segmentFilePath, tmpDir string } } log.Info(fmt.Sprintf("[%s] Positional dictionary", logPrefix), "size", offset, "position cutoff", positionCutoff) - df, err := os.Create("huffman_codes.txt") + huffmanFile := filepath.Join(tmpDir, "huffman_codes.txt") + defer os.Remove(huffmanFile) + df, err := os.Create(huffmanFile) if err != nil { return err }