/*
NNCP -- Node to Node copy, utilities for store-and-forward data exchange
-Copyright (C) 2016-2021 Sergey Matveev <stargrave@stargrave.org>
+Copyright (C) 2016-2022 Sergey Matveev <stargrave@stargrave.org>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
func (ctx *Ctx) NewTmpFile() (*os.File, error) {
jobsPath := filepath.Join(ctx.Spool, "tmp")
- if err := os.MkdirAll(jobsPath, os.FileMode(0777)); err != nil {
+ if err := ensureDir(jobsPath); err != nil {
return nil, err
}
fd, err := TempFile(jobsPath, "")
func (tmp *TmpFileWHash) Commit(dir string) error {
var err error
- if err = os.MkdirAll(dir, os.FileMode(0777)); err != nil {
+ if err = ensureDir(dir); err != nil {
return err
}
if err = tmp.W.Flush(); err != nil {