diff --git a/sftpfs/sftp.go b/sftpfs/sftp.go index 28721da..e41df68 100644 --- a/sftpfs/sftp.go +++ b/sftpfs/sftp.go @@ -94,8 +94,14 @@ func (s Fs) Open(name string) (afero.File, error) { 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) { - 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 {