From c26e2ba7534756eb42fe56f635e68428537daf4e Mon Sep 17 00:00:00 2001 From: Andreas Gebhardt Date: Wed, 7 Feb 2024 19:22:51 +0100 Subject: [PATCH] [WIP] remove store blocks (temporarily) --- cmd/chunks-inspect/main.go | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/cmd/chunks-inspect/main.go b/cmd/chunks-inspect/main.go index 0ec4a117a76d6..1503583ca27f7 100644 --- a/cmd/chunks-inspect/main.go +++ b/cmd/chunks-inspect/main.go @@ -18,15 +18,14 @@ var timezone = time.UTC func main() { blocks := flag.Bool("b", false, "print block details") lines := flag.Bool("l", false, "print log lines") - storeBlocks := flag.Bool("s", false, "store blocks, using input filename, and appending block index to it") flag.Parse() for _, f := range flag.Args() { - printFile(f, *blocks, *lines, *storeBlocks) + printFile(f, *blocks, *lines) } } -func printFile(filename string, blockDetails, printLines, storeBlocks bool) { +func printFile(filename string, blockDetails, printLines bool) { f, err := os.Open(filename) if err != nil { log.Printf("%s: %v", filename, err) @@ -95,19 +94,5 @@ func printFile(filename string, blockDetails, printLines, storeBlocks bool) { } } } - - //if storeBlocks { - // writeBlockToFile(b.rawData, ix, fmt.Sprintf("%s.block.%d", filename, ix)) - // writeBlockToFile(b.originalData, ix, fmt.Sprintf("%s.original.%d", filename, ix)) - //} - } -} - -func writeBlockToFile(data []byte, blockIndex int, filename string) { - err := os.WriteFile(filename, data, 0644) - if err != nil { - log.Println("Failed to store block", blockIndex, "to file", filename, "due to error:", err) - } else { - log.Println("Stored block", blockIndex, "to file", filename) } }