added preload status and cancel
This commit is contained in:
parent
0c9fb06263
commit
a069baf48d
10 changed files with 153 additions and 35 deletions
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue