)
var (
+ ErrPathEscapes = errors.New("ErrPathEscapes")
ErrCopy = errors.New("ErrCopy")
ErrGetRW = errors.New("ErrGetRW")
ErrFilePathTooLong = errors.New("ErrFilePathTooLong")
func (t *File) IsExist() bool {
_, err := t.Stat()
- if errors.Is(err, ErrFilePathTooLong) {
- panic(err)
+ if err != nil {
+ if errors.Is(err, ErrFilePathTooLong) {
+ panic(err)
+ } else if strings.HasSuffix(err.Error(), "path escapes from parent") {
+ panic(ErrPathEscapes)
+ }
}
return err == nil
}