Merge pull request #158 from kklin/sftp-openfile

sftpfs: Implement OpenFile method
This commit is contained in:
Michail Kargakis 2020-04-11 00:22:21 +02:00 committed by GitHub
commit ceb6a5e372
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -94,8 +94,14 @@ func (s Fs) Open(name string) (afero.File, error) {
return FileOpen(s.client, name) return FileOpen(s.client, name)
} }
// OpenFile calls the OpenFile method on the SSHFS connection. The mode argument
// is ignored because it's ignored by the github.com/pkg/sftp implementation.
func (s Fs) OpenFile(name string, flag int, perm os.FileMode) (afero.File, error) { func (s Fs) OpenFile(name string, flag int, perm os.FileMode) (afero.File, error) {
return nil, nil sshfsFile, err := s.client.OpenFile(name, flag)
if err != nil {
return nil, err
}
return &File{fd: sshfsFile}, nil
} }
func (s Fs) Remove(name string) error { func (s Fs) Remove(name string) error {