Browse Source

archium - go/src (20201207)

master
Marko Seidel 2 years ago
parent
commit
4c5fa906dd
  1. 17
      helper/tools/tools.go

17
helper/tools/tools.go

@ -134,16 +134,27 @@ func GetTexfile(_file string) (*os.File, error) {
return impfile, err
}
func DeteteFiles(_path string, _name string) {
func DeleteDirectory(_path string) error {
var err error = nil
if _, err := os.Stat(_path); os.IsNotExist(err) {
err := os.MkdirAll(_path, 0755)
if err != nil {
return err
}
}
return err
}
func DeleteFiles(_path string, _name string) {
txtlist, err := FindFilesBySuffix(_path, _name)
if err != nil {
log.Fatalf("failed deleting files: %s", err)
}
// fmt.Println(txtlist)
for _, tv := range txtlist {
err := os.Remove(_path + tv)
err := os.Remove(tv)
if err != nil {
fmt.Printf("### %s%s: %s", _path, tv, err)
fmt.Printf("### %s: %s\n", tv, err)
}
}
}

Loading…
Cancel
Save