Skip to content

Commit

Permalink
Fix FS delete
Browse files Browse the repository at this point in the history
  • Loading branch information
mjh1 committed May 2, 2024
1 parent ac33a3c commit decbcca
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions drivers/fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"net/url"
"os"
"path"
"path/filepath"
"strings"
"sync"
"time"
Expand Down Expand Up @@ -129,7 +128,7 @@ func (ostore *FSSession) ListFiles(ctx context.Context, dir, delim string) (Page
}

func (ostore *FSSession) DeleteFile(ctx context.Context, name string) error {
return os.Remove(filepath.Join(ostore.path, name))
return os.Remove(ostore.getAbsoluteURI(name))
}

func (ostore *FSSession) ReadData(ctx context.Context, name string) (*FileInfoReader, error) {
Expand Down
2 changes: 1 addition & 1 deletion drivers/fs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func TestDeleteFile(t *testing.T) {
// Try to delete the file
u, err := url.Parse(os.TempDir())
require.NoError(t, err)
sess := NewFSDriver(u).NewSession(os.TempDir())
sess := NewFSDriver(u).NewSession("")
require.NoError(t, sess.DeleteFile(context.Background(), filepath.Base(file.Name())))

// Check the file no longer exists
Expand Down

0 comments on commit decbcca

Please sign in to comment.