feature (nfs): improve nfs implementation

This commit is contained in:
MickaelK
2024-01-06 17:42:02 +11:00
parent 409f1bc09f
commit 0367f45089

View File

@ -135,7 +135,10 @@ func (this Nfs4Share) Cat(path string) (io.ReadCloser, error) {
return nil, err return nil, err
} }
pr, pw := io.Pipe() pr, pw := io.Pipe()
go this.client.ReadFileAll(path, pw) go func() {
_, _ = this.client.ReadFileAll(path, pw)
pw.Close()
}()
return pr, nil return pr, nil
} }
@ -145,10 +148,10 @@ func (this Nfs4Share) Mkdir(path string) error {
func (this Nfs4Share) Rm(path string) error { func (this Nfs4Share) Rm(path string) error {
if strings.HasSuffix(path, "/") { if strings.HasSuffix(path, "/") {
return ErrNotImplemented
}
return nfs4.RemoveRecursive(this.client, path) return nfs4.RemoveRecursive(this.client, path)
} }
return this.client.DeleteFile(path)
}
func (this Nfs4Share) Mv(from string, to string) error { func (this Nfs4Share) Mv(from string, to string) error {
return ErrNotImplemented return ErrNotImplemented