mirror of
https://github.com/drakkan/sftpgo.git
synced 2024-11-21 23:20:24 +00:00
sftpfs: improve rename and remove
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
parent
6d3ff5a8ad
commit
4ed6e96c7b
4 changed files with 9 additions and 3 deletions
2
.github/workflows/development.yml
vendored
2
.github/workflows/development.yml
vendored
|
@ -16,7 +16,7 @@ jobs:
|
|||
upload-coverage: [true]
|
||||
include:
|
||||
- go: 1.17
|
||||
os: windows-latest
|
||||
os: windows-2019
|
||||
upload-coverage: false
|
||||
|
||||
steps:
|
||||
|
|
|
@ -23,7 +23,7 @@ info:
|
|||
SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, an S3 user that exposes a GCS bucket (or part of it) on a specified path and an encrypted local filesystem on another one.
|
||||
Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user.
|
||||
SFTPGo allows to create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date.
|
||||
version: 2.2.2
|
||||
version: 2.2.2-dev
|
||||
contact:
|
||||
name: API support
|
||||
url: 'https://github.com/drakkan/sftpgo'
|
||||
|
|
|
@ -2,7 +2,7 @@ package version
|
|||
|
||||
import "strings"
|
||||
|
||||
const version = "2.2.2"
|
||||
const version = "2.2.2-dev"
|
||||
|
||||
var (
|
||||
commit = ""
|
||||
|
|
|
@ -324,6 +324,9 @@ func (fs *SFTPFs) Rename(source, target string) error {
|
|||
if err := fs.checkConnection(); err != nil {
|
||||
return err
|
||||
}
|
||||
if _, ok := fs.sftpClient.HasExtension("posix-rename@openssh.com"); ok {
|
||||
return fs.sftpClient.PosixRename(source, target)
|
||||
}
|
||||
return fs.sftpClient.Rename(source, target)
|
||||
}
|
||||
|
||||
|
@ -332,6 +335,9 @@ func (fs *SFTPFs) Remove(name string, isDir bool) error {
|
|||
if err := fs.checkConnection(); err != nil {
|
||||
return err
|
||||
}
|
||||
if isDir {
|
||||
return fs.sftpClient.RemoveDirectory(name)
|
||||
}
|
||||
return fs.sftpClient.Remove(name)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue