Skip to content

armgit / ARTEX

Public Imported from GitHub
0

ARTEX - AI autonomous penetration testing system (English translation; upstream: Autumn-27/ARTEX, AGPL-3.0)

296 B
Raw Blame
//go:build unix

package server

import (
	"errors"
	"os"
)

// syncDir flushes a directory, so that an entry just created or renamed in it
// survives a crash.
func syncDir(path string) error {
	d, err := os.Open(path)
	if err != nil {
		return err
	}
	return errors.Join(d.Sync(), d.Close())
}