aboutsummaryrefslogtreecommitdiff
path: root/hotline/file_store.go
diff options
context:
space:
mode:
authorJeff Halter <868228+jhalter@users.noreply.github.com>2022-05-30 21:37:19 -0700
committerJeff Halter <868228+jhalter@users.noreply.github.com>2022-05-30 21:37:19 -0700
commit85767504e4dc622c5ff469733e49c0cebcee57f1 (patch)
treedfb91b3094dff7c20d13dc5df6e6f8e0cbd7c7f8 /hotline/file_store.go
parent25f0d77de4489c6759a497617606f2933ca76fc9 (diff)
Fix and refactor file transfers to handle resource forks
Diffstat (limited to 'hotline/file_store.go')
-rw-r--r--hotline/file_store.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/hotline/file_store.go b/hotline/file_store.go
index e9d083f..ed0ffa4 100644
--- a/hotline/file_store.go
+++ b/hotline/file_store.go
@@ -13,6 +13,7 @@ type FileStore interface {
Open(name string) (*os.File, error)
Symlink(oldname, newname string) error
Remove(name string) error
+ Create(name string) (*os.File, error)
// TODO: implement these
// Rename(oldpath string, newpath string) error
// RemoveAll(path string) error
@@ -40,6 +41,10 @@ func (fs *OSFileStore) Remove(name string) error {
return os.Remove(name)
}
+func (fs *OSFileStore) Create(name string) (*os.File, error) {
+ return os.Create(name)
+}
+
type MockFileStore struct {
mock.Mock
}
@@ -72,3 +77,8 @@ func (mfs *MockFileStore) Remove(name string) error {
args := mfs.Called(name)
return args.Error(0)
}
+
+func (mfs *MockFileStore) Create(name string) (*os.File, error) {
+ args := mfs.Called(name)
+ return args.Get(0).(*os.File), args.Error(1)
+}