-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sftp writes should truncate 154 #155
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
47e2b52
added io integration tests based on unix fs behaviors
funkyshu 8e27302
Updated sftp backend to overwrite except after read/seek. fixes #154
funkyshu 51827a9
address lint issues
funkyshu fcec3f4
update changelog
funkyshu 0c9b0ea
fixed type in changelog
funkyshu 60c2b27
forgot to add back intergration flags
funkyshu 3c43fc0
remove no-longer-relevant comment from test case
funkyshu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 { | ||
funkyshu marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only moved contents of this file to common.go.