-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sftp writes should truncate 154 (#155)
* added io integration tests based on unix fs behaviors * Updated sftp backend to overwrite except after read/seek. fixes #154 * address lint issues * update changelog * fixed type in changelog * forgot to add back intergration flags * remove no-longer-relevant comment from test case
- Loading branch information
Showing
5 changed files
with
650 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
package testsuite | ||
|
||
import ( | ||
"os" | ||
|
||
"github.com/c2fo/vfs/v6" | ||
"github.com/c2fo/vfs/v6/backend/azure" | ||
"github.com/c2fo/vfs/v6/backend/ftp" | ||
"github.com/c2fo/vfs/v6/backend/gs" | ||
"github.com/c2fo/vfs/v6/backend/mem" | ||
_os "github.com/c2fo/vfs/v6/backend/os" | ||
"github.com/c2fo/vfs/v6/backend/s3" | ||
"github.com/c2fo/vfs/v6/backend/sftp" | ||
) | ||
|
||
func CopyOsLocation(loc vfs.Location) vfs.Location { | ||
cp := *loc.(*_os.Location) | ||
ret := &cp | ||
|
||
// setup os location | ||
exists, err := ret.Exists() | ||
if err != nil { | ||
panic(err) | ||
} | ||
if !exists { | ||
err := os.Mkdir(ret.Path(), 0750) | ||
if err != nil { | ||
panic(err) | ||
} | ||
} | ||
|
||
return ret | ||
} | ||
|
||
func CopyMemLocation(loc vfs.Location) vfs.Location { | ||
cp := *loc.(*mem.Location) | ||
return &cp | ||
} | ||
|
||
func CopyS3Location(loc vfs.Location) vfs.Location { | ||
cp := *loc.(*s3.Location) | ||
return &cp | ||
} | ||
|
||
func CopySFTPLocation(loc vfs.Location) vfs.Location { | ||
cp := *loc.(*sftp.Location) | ||
return &cp | ||
} | ||
|
||
func CopyFTPLocation(loc vfs.Location) vfs.Location { | ||
cp := *loc.(*ftp.Location) | ||
return &cp | ||
} | ||
|
||
func CopyGSLocation(loc vfs.Location) vfs.Location { | ||
cp := *loc.(*gs.Location) | ||
return &cp | ||
} | ||
|
||
func CopyAzureLocation(loc vfs.Location) vfs.Location { | ||
cp := *loc.(*azure.Location) | ||
return &cp | ||
} |
Oops, something went wrong.