Cloudreve/pkg/util/io.go

13 lines
227 B
Go

package util
import "os"
// Exists reports whether the named file or directory exists.
func Exists(name string) bool {
if _, err := os.Stat(name); err != nil {
if os.IsNotExist(err) {
return false
}
}
return true
}