added preload status and cancel

This commit is contained in:
ston1th 2022-03-16 01:58:10 +01:00
commit a069baf48d
10 changed files with 153 additions and 35 deletions

View file

@ -4,13 +4,14 @@ package fs
import (
"context"
"net/http"
"os"
"golang.org/x/net/webdav"
)
type WebDavFile struct {
*File
http.File
}
func (*WebDavFile) Write(_ []byte) (int, error) {
@ -41,7 +42,10 @@ func (w *WebDavFS) OpenFile(_ context.Context, name string, flags int, _ os.File
flags&os.O_TRUNC == os.O_TRUNC {
return nil, os.ErrPermission
}
f, err := w.fs.OpenFile(name)
f, err := w.fs.Open(name)
if err != nil {
return nil, err
}
return &WebDavFile{f}, err
}