tests clear

This commit is contained in:
bel
2025-04-04 23:09:29 -06:00
parent dc8c9fdf0c
commit caef12deb8
2 changed files with 45 additions and 0 deletions

View File

@@ -95,6 +95,9 @@ func foundOne(ctx context.Context, outd, inf string, fields Fields, mvNLn MvNLn)
}
func RealMvNLn(outf, inf string) error {
if stat, err := os.Stat(inf); err != nil || !stat.Mode().IsRegular() {
return fmt.Errorf("cannot mv_n_ln(%s): (%v) mode=%v", inf, err, stat.Mode())
}
if _, err := os.Stat(outf); err == nil {
return nil // fmt.Errorf("conflict: %s already exists", path.Base(outf))
}