Skip to content

Commit

Permalink
Merge pull request #158 from kklin/sftp-openfile
Browse files Browse the repository at this point in the history
sftpfs: Implement OpenFile method
  • Loading branch information
0xmichalis committed Apr 10, 2020
2 parents 02a77d4 + 887ec81 commit ceb6a5e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion sftpfs/sftp.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit ceb6a5e

Please sign in to comment.