]> Cypherpunks.ru repositories - nncp.git/blobdiff - src/cmd/nncp-reass/main.go
Replace YAML with Hjson
[nncp.git] / src / cmd / nncp-reass / main.go
index a798bd37f0e02f2044fb4de036b45e9c7ad7dfb2..7ca8db871339230addc337fc22b32c32491102d0 100644 (file)
@@ -26,7 +26,6 @@ import (
        "fmt"
        "hash"
        "io"
-       "io/ioutil"
        "log"
        "os"
        "path/filepath"
@@ -35,7 +34,7 @@ import (
 
        "github.com/davecgh/go-xdr/xdr2"
        "github.com/dustin/go-humanize"
-       "go.cypherpunks.ru/nncp/v4"
+       "go.cypherpunks.ru/nncp/v5"
        "golang.org/x/crypto/blake2b"
 )
 
@@ -172,7 +171,7 @@ func process(ctx *nncp.Ctx, path string, keep, dryRun, stdout, dumpMeta bool) bo
                dst = os.Stdout
                sds = nncp.SDS{"path": path}
        } else {
-               tmp, err = ioutil.TempFile(mainDir, "nncp-reass")
+               tmp, err = nncp.TempFile(mainDir, "reass")
                if err != nil {
                        log.Fatalln(err)
                }
@@ -233,7 +232,7 @@ func process(ctx *nncp.Ctx, path string, keep, dryRun, stdout, dumpMeta bool) bo
                        }
                        log.Fatalln(err)
                }
-               dstPath = dstPathOrig + strconv.Itoa(dstPathCtr)
+               dstPath = dstPathOrig + "." + strconv.Itoa(dstPathCtr)
                dstPathCtr++
        }
        if err = os.Rename(tmp.Name(), dstPath); err != nil {