mirror of
				https://github.com/mickael-kerjean/filestash.git
				synced 2025-11-04 05:27:04 +08:00 
			
		
		
		
	feature (nfs): improve nfs implementation
This commit is contained in:
		@ -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,9 +148,9 @@ 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 {
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user