ipld-eth-server/vendor/github.com/ipfs/go-ipfs-util/file.go

13 lines
245 B
Go

package util
import "os"
// FileExists check if the file with the given path exits.
func FileExists(filename string) bool {
fi, err := os.Lstat(filename)
if fi != nil || (err != nil && !os.IsNotExist(err)) {
return true
}
return false
}