mirror of
https://github.com/mickael-kerjean/filestash
synced 2025-12-27 02:35:18 +01:00
fix (sftp): fix for sftp on coviantsoftware - mft diplomat
This commit is contained in:
parent
110280e94b
commit
f9b50e823e
1 changed files with 3 additions and 2 deletions
|
|
@ -264,16 +264,17 @@ func (b Sftp) Mv(from string, to string) error {
|
|||
}
|
||||
|
||||
func (b Sftp) Touch(path string) error {
|
||||
file, err := b.SFTPClient.Create(path)
|
||||
file, err := b.SFTPClient.OpenFile(path, os.O_WRONLY|os.O_CREATE)
|
||||
if err != nil {
|
||||
return b.err(err)
|
||||
}
|
||||
_, err = file.ReadFrom(strings.NewReader(""))
|
||||
file.Close()
|
||||
return b.err(err)
|
||||
}
|
||||
|
||||
func (b Sftp) Save(path string, file io.Reader) error {
|
||||
remoteFile, err := b.SFTPClient.Create(path)
|
||||
remoteFile, err := b.SFTPClient.OpenFile(path, os.O_WRONLY|os.O_CREATE|os.O_TRUNC)
|
||||
if err != nil {
|
||||
return b.err(err)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue