spf13 / afero

A FileSystem Abstraction System for Go
Apache License 2.0
5.93k stars 508 forks source link

Add sftpfs files WriteAt and Sync methods #429

Open MRtecno98 opened 2 months ago

MRtecno98 commented 2 months ago

Similarly to #378 the WriteAt and Sync methods are also missing and a TODO despite being implemented by sftp.File already.

Also may i suggest just nesting sftp.File into sftpfs.File to have all necessary interfaces implemented without delegate methods? Something like this

type File struct {
        *sftp.File
    client *sftp.Client
}

This would allow removing methods Close Name Stat Sync Truncate Read ReadAt Seek Write WriteAt which are just simple delegates. I'll gladly implement the change if it's ok otherwise you can just merge this pr as it is.