Files
crawlab/backend/model/file.go
2019-09-10 09:32:48 +08:00

26 lines
397 B
Go

package model
import (
"crawlab/utils"
"github.com/apex/log"
"os"
)
type File struct {
Name string `json:"name"`
Path string `json:"path"`
IsDir bool `json:"is_dir"`
Size int64 `json:"size"`
}
func RemoveFile(path string) error {
if !utils.Exists(path) {
log.Info("file not found: " + path)
return nil
}
if err := os.Remove(path); err != nil {
return err
}
return nil
}